1, confirm the local sshd configuration file (requires root permissions)
$ gedit/etc/ssh/sshd_config
Find the following and remove the annotation "#"
Rsaauthentication Yes
pubkeyauthentication Yes
authorizedkeysfile. Ssh/authorized_keys
2, if the configuration file changes need to restart the sshd service (requires root permissions)
$/sbin/service sshd Restart
Configuring SSH Password-free logon takes 3 steps:
1. Generate public and private keys
2. Import public key to authentication file, change permissions
3. Test
1. Generate public and private keys
Shell code: SSH-KEYGEN-T RSA
Two files are generated by default in the ~/.ssh directory:
Id_rsa: Private key
Id_rsa.pub: Public Key
2. Import public key to authentication file, change permissions
2.1 Import this machine
Shell code: Cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
2.2 Importing servers for password-free logins
First copy the public key to the server
Shell code: SCP ~/.ssh/id_rsa.pub xxx@host:/home/id_rsa.pub
The public key is then imported into the authentication file (this step is done on the server)
Shell code: Cat/home/id_rsa.pub >> ~/.ssh/authorized_keys
2.3 Changing permissions on the server
Shell code: chmod ~/.ssh
chmod ~/.ssh/authorized_keys
3. Test SSH XXX
The above is a small set to introduce the CentOS SSH without password login configuration, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!