2013-03-27 32 views
-1

我使用命令ssh -i /home/ssh_keys/10_1_1_127 [email protected] date檢查另一臺機器上的日期SSH失敗,如何讓如有參數錯誤

如果某些參數是錯誤的,喜歡的用戶,IP地址或身份文件沒有按「T存在, SSH詢問密碼

例如,如果我寫ssh -i /home/ssh_keys/10_1_1_1277 [email protected] date 同時/home/ssh_keys/10_1_1_1277不存在,我得到:

[email protected]'s password:

我想知道是否有可能,如果是這樣,那麼如果一些參數不正確,如何使ssh失敗,那麼如果我輸入錯誤的參數,ssh將不會要求我輸入密碼...

謝謝

回答

1

所有這些更改應通過rootsudo啓用用戶完成。

/etc/ssh/sshd_config設置以下條目號:

ChallengeResponseAuthentication no 
PasswordAuthentication no 
UsePAM no 

如果您需要幫助尋找這些特定的線路,使用grep:

grep -n "PasswordAuthentication" /etc/ssh/sshd_config 
      ^^or whatever^^ 

它輸出的行號

然後重啓ssh

/etc/init.d/ssh restart

service ssh restart

具體取決於Linux的味道。