In order to simplify the SSH process, the use of the certificate method, the SSH login to avoid the need to enter the account password process, the specific operation is as follows:
One, on the machine where the SSH server
1. Log in as root, change the SSH config file/etc/ssh/sshd_config, and remove the comments from the following configuration
rsaauthentication Yes #启用rsa认证PubkeyAuthentication Yes #启用公钥私钥配对认证方式AuthorizedKeysFile. ssh/authorized_keys #公钥文件路径
2. Restart the SSH service
[[email protected]/] #systemctl restart sshd // restart SSH service
Second, on the client machine
1. Generate public key private key pair
[[email protected]/]#ssh-keygen -t RSA
All the way to the default carriage return, the system generates ID_RSA, id_rsa.pub under/root/.ssh
2, send the id_rsa.pub to the server machine
[[email protected]/]#ssh-copy-ID -i/root/. SSH 192.168. 1.20 #server IP
3. Verification
[[email protected]/]#ssh192.168. 1.20 #server IP
Configure SSH trust between Linux (SSH password-free login)