SSH 不用密碼登入 - Linux

By Carolina Franco
at 2014-09-03T20:33
at 2014-09-03T20:33
Table of Contents
※ 引述《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 {} \;
--
: 想要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 {} \;
--
Tags:
Linux
All Comments
Related Posts
SSH 不用密碼登入

By Frederica
at 2014-09-03T16:23
at 2014-09-03T16:23
128MB的舊筆電想當server

By Adele
at 2014-09-02T22:40
at 2014-09-02T22:40
virtual box中無法調整螢幕解析度

By Linda
at 2014-09-02T18:11
at 2014-09-02T18:11
virtual box中無法調整螢幕解析度

By Michael
at 2014-09-02T15:11
at 2014-09-02T15:11
如何顯示最後幾行行號?

By Daniel
at 2014-09-02T01:44
at 2014-09-02T01:44