ssh authentication魔鬼細節--.ssh文件夾權限


換到7后出現莫名奇妙問題,ssh驗證始終不起作用。

服務器

centos7#mkdir ~/.ssh
centos7#touch ~/.ssh/authorized_keys
centos7#chmod 600 ~/.ssh/authorized_keys

 

客戶端

client$ssh-copy-id 'root'@xxx.xxx.xxx.xxx

 

結果反復都需要輸入密碼,用

client$ssh -v 'root'@'xxx.xxx.xxx.xxx'

 無法定位出原因,看了下官方資料

注意到

$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/id_rsa 

 

試了下:

centos7#chmod 700 ~/.ssh

 

再試,通過!

特記錄此坑爹細節(貌似在centos6不需要此步)

 

實際在拷貝公鑰時建議使用指令

ssh-copy-id user@host

 

 

來源:http://www.cnblogs.com/Tommy-Yu/p/5497246.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM