SSH daemon failed to start (code=exited, status=127)

Hello Everyone!

During my iPad SSH setup my PC’s SSH daemon stop working, I can’t find any resources online. When I try to start the SSH daemon, it keep getting this error.

× sshd.service - OpenSSH Daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: dis>
     Active: failed (Result: exit-code) since Mon 2023-01-02 22:01:57 EST; 38s >
   Duration: 1ms
    Process: 5080 ExecStart=/usr/bin/sshd -D (code=exited, status=127)
   Main PID: 5080 (code=exited, status=127)
        CPU: 1ms

Jan 02 22:01:57 Linux-PC systemd[1]: sshd.service: Scheduled restart job, resta>
Jan 02 22:01:57 Linux-PC systemd[1]: Stopped OpenSSH Daemon.
Jan 02 22:01:57 Linux-PC systemd[1]: sshd.service: Start request repeated too q>
Jan 02 22:01:57 Linux-PC systemd[1]: sshd.service: Failed with result 'exit-cod>
Jan 02 22:01:57 Linux-PC systemd[1]: Failed to start OpenSSH Daemon.

I am still an linux noob. :sweat_smile:

Any ideas on what can I do?
Thank you !
Best Regards.

As always, the Arch wiki comes to mind.

OpenSSH - ArchWiki

:confused:

I can only think of one reason the ssh daemon would refuse to start - and that is a malformed configuration.

Have you made changes to /etc/ssh/sshd_config?

You can start the daemon from command line and use -d to debug the daemon

man sshd
     -d      Debug mode.  The server sends verbose debug
             output to standard error, and does not put
             itself in the background.  The server also
             will not fork(2) and will only process one
             connection.  This option is only intended
             for debugging for the server.  Multiple -d
             options increase the debugging level.  Maxi‐
             mum is 3.

I was thinking especially of the first command listed there in the wiki I linked to:
sshd -t
to test for a valid configuration as the very first thing

1 Like

You can also look at journalctl -xe | grep sshd to see any logs related to sshd, so you can see why it’s crashing on start.

My guess is the same as @linux-aarhus , a malformed config.