轉載自 http://laowafang.blog.51cto.com/251518/1364298ssh
1.說明:工具
ssh無密碼用戶遠程登陸,一直以來使用是debian操做系統,對用戶目錄權限要求沒有關注過,生成了密鑰,放對位置直接就能夠使用,今天測試ansible工具,用到了CentOS6.3發現它對目錄權限要求比較嚴格,本博文僅僅記錄一下本次權限修改操做。測試
二、操做記錄操作系統
(1)建立用戶: ansiblerest
(2)修改sshd_config文件blog
# vi /etc/ssh/sshd_config //開啓如下內容it
HostKey /etc/ssh/ssh_host_rsa_keyio
RSAAuthentication yes登錄
PubkeyAuthentication yesrsa
AuthorizedKeysFile .ssh/authorized_keys
# /etc/init.d/sshd restart
(3)權限設置
# mkdir /home/ansible/.ssh
# chown -R ansible:ansible /home/ansible
# chmod 700 /home/ansible
# chmod 700 /home/ansible/.ssh
# chmod 644 /home/ansible/.ssh/authorized_keys //公鑰文件的全部權限
# chmod 600 /home/ansible/.ssh/id_rsa //私鑰文件的全部權限
### 能夠測試遠程鏈接了……