SSH 不用密碼登入 - Linux

Carolina Franco avatar
By Carolina Franco
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 {} \;


--
Tags: Linux

All Comments

SSH 不用密碼登入

Frederica avatar
By Frederica
at 2014-09-03T16:23
想要A主機登入B主機時不輸入密碼就可以登入, 目前用了Key的方式來達成, 但設定完後還是會要我輸入password, 流程如下: 1.A主機設定 (1) ssh-keygen -t rsa -f test (2) ssh-copy-id -i ~/.ssh/test.pub rootatx ...

128MB的舊筆電想當server

Adele avatar
By Adele
at 2014-09-02T22:40
我目前有一台tosshiba的超舊筆電,記憶體128MB,硬碟60GB IDE,目前裝XP, 想也知道跑不順,加上螢幕有裂掉,所以我打算當成server。 我之前有一台桌機A裝CENTOS 6.5,本身有vsFTP、SAMBA、OPENVPN、iSCSI等服務, 另外用iptables和selinux保護, ...

virtual box中無法調整螢幕解析度

Linda avatar
By Linda
at 2014-09-02T18:11
※ 引述《ireullin (raison detre)》之銘言: : 請問一下 : 我在virtual box安裝了linux : 可是在xwindow中無法調整解析度 : 我已經安裝了 guest additions 可是還是沒辦法 : 無縫模式也沒辦法選 : 可是我在google上面查 : 大家也都是說 ...

virtual box中無法調整螢幕解析度

Michael avatar
By Michael
at 2014-09-02T15:11
請問一下 我在virtual box安裝了linux 可是在xwindow中無法調整解析度 我已經安裝了 guest additions 可是還是沒辦法 無縫模式也沒辦法選 可是我在google上面查 大家也都是說只要安裝guest additions就可以了 請問大家還有其他建議嗎 我試過的linux版本 ...

如何顯示最後幾行行號?

Daniel avatar
By Daniel
at 2014-09-02T01:44
Update: 算行數時用parallel看起來比較有效. $ ls -lah H ... 7.7G ... H $ time cat H | parallel --pipe wc -l | awk and#39;{s+=$1} END {print s}and#39; 167559168 real ...