I want to restart ssh or sshd but I get this error:
qqqq@Matrix-Server:/$ sudo /etc/init.d/ssh stop
sudo: /etc/init.d/ssh: command not found
qqqq@Matrix-Server:/$
Do I need to install ssh or sshd or does it come with Ubuntu?
Install openssh-server
sudo apt-get install openssh-server
sudo initctl reload-configuration
before you can sudo service ssh start
. I think this is a bug in recent versions of ubuntu (12.10,13.04).
Jun 29, 2013 at 0:09
The sshd is the ssh server deamon. So if you want to connect to a machine via ssh you need to install a ssh server on your target machine, e.g. using
sudo apt-get install openssh-server
The command ssh is what you use to actually connect to a machine running an ssh server. You need ssh installed on the machine that you want to ssh from.
sudo apt-get install ssh
But ssh will probably already be installed if you use any decent version of Ubuntu.
Now about restarting. What do you want to restart? If you want to restart the ssh server on the other machine (e.g. if you changed the config) use
sudo /etc/init.d/ssh restart
Yes it is called ssh although the process is called sshd which might be confusing.
There's an option in Ubuntu installing procedure to automatically install SSH server, if have not choosen it you need to install the package. The complete Ubuntu SSH package includes both server daemon and client.
To install it
sudo apt-get install ssh
Often the service is named after the daemon. Try /etc/init.d/sshd
instead.