One: Generate key
Shell Point tool New user key generation
You can see the key generation interface, choose the RSA encryption algorithm, the key length is set to 2048 here.
The key has been generated, select Next, Next.
Enter the key name, and the password to encrypt the key, and proceed to the next step.
Now you can see the public key information and save the public key copy.
Create a hidden directory in the root user home directory. SSH, and create a Authorized_key file in this directory, and put the pre-generated public key into Authorized_key.
Mkdir-v ~/.ssh
Vim ~/.ssh/authorized_keys
Modify Permissions
chmod ~/.ssh/authorized_keys
chmod. ssh/
7. Clear firewall rules and turn off SELinux
Iptables-f
Setenforce 0
8 Modify the SSH configuration file and remove the comment to enable it to support key authentication. Vim/etc/ssh/sshd_config
Rsaauthentication Yes
Pubkeyauthentication Yes
Restarting the sshd service
/etc/init.d/sshd restart
9. New session fill in the name with the host, OK login
Linux System Setup key login, disable root account password login