cenos6.3 ssh 公鑰認證報錯:permission denied (publickey,gssapi-keyex,gssapi-with-mic).解決
1.說明:
ssh無密碼使用者遠端登入,一直以來使用是debian作業系統,對使用者目錄權限要求沒有關注過,生成了密鑰,放對位置直接就可以使用,今天測試ansible工具,用到了centos6.3發現它對目錄權限要求比較嚴格,本博文僅僅記錄一下本次權限修改操作。
2、操作記錄
(1)建立使用者: ansible
(2)修改sshd_config檔案
# vi /etc/ssh/sshd_config //開啟以下内容
hostkey /etc/ssh/ssh_host_rsa_key
rsaauthentication yes
pubkeyauthentication yes
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 //私鑰檔案的所有權限
### 可以測試遠端連接配接了……