Reprinted from http://laowafang.blog.51cto.com/251518/1364298
1. Description:
SSH password user remote login, has been using the Debian operating system, the user directory permission requirements have not been concerned about, generated a key, lil bit location directly can be used, today test ansible tools, Used to CentOS6.3 found it to the directory permission requirements are relatively strict, this blog only record this permission modification operation.
2. Operation Record
(1) Create User: Ansible
(2) Modify the Sshd_config file
# Vi/etc/ssh/sshd_config//Open the following
Hostkey/etc/ssh/ssh_host_rsa_key
Rsaauthentication Yes
Pubkeyauthentication Yes
Authorizedkeysfile. Ssh/authorized_keys
#/etc/init.d/sshd Restart
(3) Permission settings
# MKDIR/HOME/ANSIBLE/.SSH
# Chown-r Ansible:ansible/home/ansible
# chmod 700/home/ansible
# chmod 700/home/ansible/.ssh
# chmod all permissions for 644/home/ansible/.ssh/authorized_keys//public key file
# chmod all permissions for 600/HOME/ANSIBLE/.SSH/ID_RSA//private key files
# # # can test the remote connection ...
CenOS6.3 SSH Public key authentication error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)