Installing and setting up OpenSSH Server
sudo apt-get install SSH
Ubuntu then automatically downloads and installs the openssh server and resolves all dependencies together. When you are done, you can find another computer and then use an SSH client software (strongly recommended PuTTy) to enter your server's IP address. If it's all right, wait a little while to connect. And you should be able to log in with your existing username and password.
In fact, if there is no special need, the OpenSSH Server here is installed. But further setup will allow the OpenSSH to log in less time and be more secure. All of this is done by modifying the OpenSSH configuration file sshd_config.
First, you may find that when you experiment with remote logins, you will need to wait a long time to enter the password after entering the user name. In fact, this is due to the sshd need to back up the client's DNS information caused. We can dramatically increase the speed of the login by disabling this feature. First, open the Sshd_config file:
sudo nano/etc/ssh/sshd_config
Gssapiauthentication Yes--->no 81 lines
Usedns Yes-->usedns no 122 lines around
The main thing is to disable the DNS query feature, which speeds up the SSH connection
Then restart the SSH service:
Sudo/etc/init.d/ssh Stop
sudo/etc/init.d/ssh start
Reference Links:
https://blog.csdn.net/wanruirui/article/details/14222321