Networking

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:

sudo ssh service restart

If that doesn’t work, try this command:

sudo sshd service restart

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.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

1 day ago

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

3 days ago

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

5 days ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

1 week ago

Demystifying journalctl: A Comprehensive Guide to Linux System Logging

It was suggested that I write an article about journalctl, which seemed like a large…

1 week ago

Extract Text From Multiple File Types

Today we will have a fairly simple exercise as we're going to just use a…

2 weeks ago