I cant work with ssh

sudo pacman -S openssh
warning: openssh-9.8p1-1 is up to date – reinstalling
resolving dependencies…
looking for conflicting packages…

Package (1) Old Version New Version Net Change

core/openssh 9.8p1-1 9.8p1-1 0.00 MiB

Total Installed Size: 5.71 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [--------------------------------------] 100%
(1/1) checking package integrity [--------------------------------------] 100%
(1/1) loading package files [--------------------------------------] 100%
(1/1) checking for file conflicts [--------------------------------------] 100%
:: Processing package changes…
(1/1) reinstalling openssh [--------------------------------------] 100%
:: Running post-transaction hooks…
(1/5) Reloading system manager configuration…
(2/5) Reloading user manager configuration…
(3/5) Creating temporary files…
(4/5) Arming ConditionNeedsUpdate…
(5/5) Checking which packages need to be rebuilt
[pal@pal ~]$ sudo systemctl start sshd
Job for sshd.service failed because the control process exited with error code.
See “systemctl status sshd.service” and “journalctl -xeu sshd.service” for details.

sudo systemctl status sshd.service
[sudo] password for pal:
× sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Mon 2024-08-26 08:09:44 EEST; 7min ago
Invocation: 0bca167a59c540b4b804e5cced3f4568
Process: 20057 ExecStart=/usr/bin/sshd -D (code=exited, status=255/EXCEPTION)
Main PID: 20057 (code=exited, status=255/EXCEPTION)

Aug 26 08:09:44 pal systemd[1]: sshd.service: Scheduled restart job, restart counter is at 5.
Aug 26 08:09:44 pal systemd[1]: sshd.service: Start request repeated too quickly.
Aug 26 08:09:44 pal systemd[1]: sshd.service: Failed with result ‘exit-code’.
Aug 26 08:09:44 pal systemd[1]: Failed to start OpenSSH Daemon.

journalctl -xeu sshd.service
░░
░░ The job identifier is 9164 and the job result is failed.
Aug 26 08:09:44 pal systemd[1]: sshd.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ Automatic restarting of the unit sshd.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Aug 26 08:09:44 pal systemd[1]: sshd.service: Start request repeated too quickly.
Aug 26 08:09:44 pal systemd[1]: sshd.service: Failed with result ‘exit-code’.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit sshd.service has entered the ‘failed’ state with result ‘exit-code’.
Aug 26 08:09:44 pal systemd[1]: Failed to start OpenSSH Daemon.
░░ Subject: A start job for unit sshd.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit sshd.service has finished with a failure.
░░
░░ The job identifier is 9265 and the job result is failed.

This is 100% a job for chatgpt

sudo systemctl enable --now sshd
# then reboot for good measure...

Does that make a difference?

Double-check you have allowed the SSH service in your firewall. https://discovery.endeavouros.com/applications/firewalld/

1 Like

sudo systemctl enable --now sshd
[sudo] password for pal:
Job for sshd.service failed because the control process exited with error code.
See “systemctl status sshd.service” and “journalctl -xeu sshd.service” for details.

Its not installed
[pal@pal ~]$ sudo pacman -Qqe | grep firewall
[pal@pal ~]$

I’ll try to install Manjaro. Maybe the SSHD will start there.On the ArchLinux forum they don’t even want to hear about forks of their system

I installed Manjaro XFCE on the same computer and on the same disk

uname -a
Linux pal 6.9.12-1-MANJARO #1 SMP PREEMPT_DYNAMIC Sat Jul 27 14:46:06 UTC 2024 x86_64 GNU/Linux

[pal@pal ~]$ sudo systemctl start sshd
[pal@pal ~]$ sudo systemctl status sshd
● sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; preset: di>
Active: active (running) since Tue 2024-08-27 09:44:21 EEST; 12s ago
Invocation: 072a588e83cb47a7b07a3c6d43f652e2
Main PID: 16437 (sshd)
Tasks: 1 (limit: 4653)
Memory: 1.5M (peak: 1.7M)
CPU: 18ms
CGroup: /system.slice/sshd.service
└─16437 “sshd: /usr/bin/sshd -D [listener] 0 of 10-100 startups”

27 09:44:21 pal systemd[1]: Starting OpenSSH Daemon…
27 09:44:21 pal sshd[16437]: Server listening on 0.0.0.0 port 22.
27 09:44:21 pal sshd[16437]: Server listening on :: port 22.
27 09:44:21 pal systemd[1]: Started OpenSSH Daemon.

sudo systemctl enable sshd

Created symlink ‘/etc/systemd/system/multi-user.target.wants/sshd.service’ → ‘/usr/lib/systemd/system/sshd.service’.

Does that mean you already has openssh installed, messed up some confings and then try to install it again with hope that it will fix it?

I would recommend uningstalling it completely first.
sudo pacman -R openssh and then removing anything related to ssh server from /etc/ssh/ and ~/.ssh or ~/.config/ssh.
Then you can install it again but so it with pacman -Syu to avoid partial update.

This won’t help. ssh didn’t work right after installing the system. I didn’t make any config settings. But in Manjaro it works right away, just like in other Linuxes I work with. (Alma,Ubuntu,Debian,Mint , MX, AntiX and FreeBSD)