ssh免密登錄失效處理


目錄

免密登錄設置完成了,ssh連接其他服務器能免密成功,但是在某個服務器上一直不成功,每次都必須輸入密碼

使用 -vvv 查看日志: ssh -vvv 用戶@ip # ssh連接時顯示日志

debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /var/lib/jenkins/.ssh/id_dsa
debug3: no such identity: /var/lib/jenkins/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /var/lib/jenkins/.ssh/id_ecdsa
debug3: no such identity: /var/lib/jenkins/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /var/lib/jenkins/.ssh/id_ed25519
debug3: no such identity: /var/lib/jenkins/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

解決方法

A服務器連接B服務器,在B服務器上修改:

# 修改文件
sudo vi /etc/ssh/sshd_config

# 設置StrictModes 為no
#StrictModes yes
StrictModes no

# 重啟服務
sudo service sshd restart


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM