※ 引述《tas72732002 (蔥頭)》之銘言:
: 想要A主機登入B主機時不輸入密碼就可以登入, 目前用了Key的方式來達成,
: 但設定完後還是會要我輸入password, 流程如下:
: 1.A主機設定
: (1) ssh-keygen -t rsa -f test
: (2) ssh-copy-id -i ~/.ssh/test.pub [email protected]
: (3) scp ~/.ssh/test.pub [email protected]:/root/.ssh
: 2.B主機設定
: (1) vi /etc/ssh/sshd_config
: PubkeyAuthentication yes
: AuthorizedKeysFile .ssh/authorized_keys
: /etc/init.d/sshd restart
: (2) chmod 644 ~/.ssh/authorized_keys && chmod 711 ~/.ssh/
: 設定完成後到A主機 ssh [email protected]
: 還是會跳出[email protected]'s password:
: 請問是什麼設定有問題嗎?
: 17:47:35 xx sshd[29829]: reverse mapping checking getaddrinfo for xxx-xxx-xxx-xxx.hinet-ip.hinet.net [xxx.xxx.xxx.xxx] failed - POSSIBLE BREAK-IN ATTEMPT!
chmod
~/.ssh -> 700
~/.ssh/*.pub -> 644
其他全部 -> 600
一行指令修正所有權限:
find ~/.ssh/ -type d -exec chmod 700 {} \; -o -name '*.pub' \
-exec chmod 644 {} \; -o -exec chmod 600 {} \;
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.251.86
※ 文章網址: http://www.ptt.cc/bbs/Linux/M.1409747605.A.636.html
※ 編輯: newversion (140.112.251.86), 09/03/2014 21:37:25