1

I changed what port my raspberry pi was listening on, as I'm currently blocked from adding a rule on my router for port 22.

I did sudo nano /etc/ssh/sshd_config

and changed #port 22 to port 2234 (removing the #)

I then tried to restart the service through sudo /etc/init.d/ssh restart and got a failed status.

I tried checking the status through sudo /etc/init.d/ssh status

and I got

● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
   Active: failed (Result: exit-code) since Tue 2019-04-02 18:00:04 CDT; 12min a
  Process: 474 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255)

Apr 02 18:00:03 raspberrypi systemd[1]: Failed to start OpenBSD Secure Shell ser
Apr 02 18:00:03 raspberrypi systemd[1]: ssh.service: Unit entered failed state.
Apr 02 18:00:03 raspberrypi systemd[1]: ssh.service: Failed with result 'exit-co
Apr 02 18:00:04 raspberrypi systemd[1]: ssh.service: Service hold-off time over,
Apr 02 18:00:04 raspberrypi systemd[1]: Stopped OpenBSD Secure Shell server.
Apr 02 18:00:04 raspberrypi systemd[1]: ssh.service: Start request repeated too 
Apr 02 18:00:04 raspberrypi systemd[1]: Failed to start OpenBSD Secure Shell ser
Apr 02 18:00:04 raspberrypi systemd[1]: ssh.service: Unit entered failed state.
Apr 02 18:00:04 raspberrypi systemd[1]: ssh.service: Failed with result 'exit-co
lines 1-14/14 (END)...skipping...
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-04-02 18:00:04 CDT; 12min ago
  Process: 474 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255)

Apr 02 18:00:03 raspberrypi systemd[1]: Failed to start OpenBSD Secure Shell server.
Apr 02 18:00:03 raspberrypi systemd[1]: ssh.service: Unit entered failed state.
Apr 02 18:00:03 raspberrypi systemd[1]: ssh.service: Failed with result 'exit-code'.
Apr 02 18:00:04 raspberrypi systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Apr 02 18:00:04 raspberrypi systemd[1]: Stopped OpenBSD Secure Shell server.
Apr 02 18:00:04 raspberrypi systemd[1]: ssh.service: Start request repeated too quickly.
Apr 02 18:00:04 raspberrypi systemd[1]: Failed to start OpenBSD Secure Shell server.
Apr 02 18:00:04 raspberrypi systemd[1]: ssh.service: Unit entered failed state.
Apr 02 18:00:04 raspberrypi systemd[1]: ssh.service: Failed with result 'exit-code'.

Any suggestions how to get sshd running again?

  • please try the suggestion in the error message Some lines were ellipsized, use -l to show in full that way you'll see the error in full - because Failed with result 'exi…e' means next to nothing – Jaromanda X Apr 2 at 23:09
  • @JaromandaX edited original post – Endl3ss Apr 2 at 23:14
  • If you change it back, does it work? – Jaromanda X Apr 2 at 23:16
  • just tried. Weirdly doesnt. i get Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. – Endl3ss Apr 2 at 23:22
  • so, it's not working - perhaps you broke something in your original edit – Jaromanda X Apr 2 at 23:22
2

that's not the right way to restart it. Use systemctl restart ssh.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.