換到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