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.
It is possible that the service is not called sshd. you can try this command
On my ubuntu 18.04, the service is called ssh by default.
in my case, I did
If that doesn't solve your problem, you can reinstall ssh
returned nothing at all, so I removed and re-installed as you suggested.
I also rebooted after re-installing just in case (I had rebooted before, but it did not help). It seems to be okay now. If I try that command again, I get:
and if I run:
I get:
So it looks to be okay now - at least as far as I can tell.
Thanks,
Alan.