How To: Restart SSH

Today’s article will be a very short and easy article, where we learn how to restart SSH. This involves restarting the SSH service. It may not even require a second section, it’s that easy. No, it probably will, just to keep things uniform. So, to learn how to restart SSH read on!

This one is drawn from my own frustration. I recently have had to deal with this a couple of times and I’m not sure why. I’ll root through the logs to figure it out at some point, but the obvious issue here is that I had issues with SSH stopping. More specifically, the SSH daemon/service stopped running.

In my case, I was able to just use another remote connection to the device. I suppose I could have just walked across the house, but it was easier to just use TeamViewer.

Oddly, I’ve had TeamViewer cause problems before. I even have an article detailing how to restart TeamViewer from the terminal (via SSH, I suppose).

So, rather than rebooting the system, I just connected via an alternative method and restarted SSH. It’s easily done.

Restart SSH:

You’ll first need some way of connecting to the device with the stopped SSH service. In the opening section, I mentioned doing so with TeamViewer. It pays to have a backup method to connect to your servers, so you could use VNC or something else that works for you.

If you physically go to the device, or remotely connect to the device, you’ll need a terminal to work with. So, open a terminal. Depending on how you’re connected, you might have to find the terminal in the menu as not all keyboard shortcuts will be passed to the remote computer.

So, once you have a terminal open on the remote computer, try this command:

If that doesn’t work, try this command:

One of those should work for you. Make note of which one works and you, if you think you’ll be doing it often. You can also ‘stop‘ and ‘start‘ services, easily enough, but just a restart should do the trick.

Closure:

See? I told you that it’d be quick and easy. I could use a quick and easy article right now, and this subject just happens to be something I’m currently thinking of. So, you get this as an article, an article about how you restart SSH. Simple and easy…

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.