1. Install SSH:$ sudo apt-get install SSH
2. See if the catalog is generated. SSH:$ ls-al/home/ubuntu/
3. If not, create the directory manually. SSH:$ mkdir/home/ubuntu/.ssh
4. Generate public and private keys:$ ssh-keygen-t dsa-p '-f ~/.SSH/ID_DSA or $ ssh-keygen-t RSA
5. Add the public key to the public key file used for authentication:$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys or CP ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
6. Verify that the SSH installation is successful:$ ssh-version
7. Password-Free login:Copy the Id_rsa to the rest of the machines to log in to SSH x.x.x.x
8. Password-Free login:
To disable all users via SSH login to the system by user name + password, modify the/etc/ssh/sshd_config file, the Allow password verification this line to No:
# Change to No to disable tunnelled clear text passwords
Passwordauthentication No
If you only want to prevent some users from logging in to the SSH service with a password, you can use the password of the locked user in the passwd command as an example of the user:
Passwd-l User
Ubuntu configuration ssh password-free login