SSH is divided into client (openssh-client) and server (openssh-server).
If you just want to log in to SSH of other machines, you only need to install openssh-client;
Openssh-client is installed by default on Ubuntu system.
If not, you can install it through sudo apt install openssh-client.
if you need to open SSH service on your own machine, you need to install openssh-server.
Similarly, use apt to install openssh-server.
ylspirit@ubuntu:~$ sudo apt install openssh-server
Start the openssh-server service. The service name is sshd.
You can view the command startup through PS command.
ylspirit@ubuntu:~$ service sshd start
ylspirit@ubuntu:~$ ps -ef | grep sshd
Here, other computer can connect to the local machine through SSH.
First, look at the local IP address.
ylspirit@ubuntu:~$ ifconfig
Then, on another computer, connect to 192.168.159.131 through SSH command.
➜ ~ ssh ylspirit@192.168.159.131
OK, the installation and use of Ubuntu SSH service is finished.