20

I have a machine running Ubuntu 18.04 LTS where I cannot seem to get SSH Server working.

I installed SSHServer using:

sudo apt install openssh-server

but I am getting the following when I try to start and / or check the status:

sudo systemctl start sshd

Failed to start sshd.service: Unit sshd.service not found.

.

sudo systemctl status sshd

Unit sshd.service could not be found.

I figured I must have done something wrong (typo?) when I installed, so I tried to install again thus:

sudo apt install openssh-server

to which I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
openssh-server is already the newest version (1:7.6p1-4ubuntu0.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So, it appears it is installed, but for some reason Ubuntu cannot find it.

I am not sure where to go from here, so any suggestions would be welcome.

Thanks,

Alan.

2
  • I followed this and it worked.
    – TonyB
    Commented Jul 28, 2019 at 4:05
  • I think it is fixed by removing and reinstalling, but I have bookmarked the link to gave and will follow that next time I need to install ssh server. Thanks!
    – Alan
    Commented Jul 28, 2019 at 6:00

1 Answer 1

25

It is possible that the service is not called sshd. you can try this command

systemctl -l --type service --all|grep ssh

On my ubuntu 18.04, the service is called ssh by default.

in my case, I did

sudo systemctl start ssh

If that doesn't solve your problem, you can reinstall ssh

sudo apt-get remove --purge openssh-server
sudo apt-get update
sudo apt-get install openssh-server

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .