一個(gè)樹(shù)莓派鏡像,啟動(dòng)后發(fā)現(xiàn)沒(méi)有 sshd 功能,于是 啟用 openssh,重新啟動(dòng),又發(fā)現(xiàn)樹(shù)莓派拒絕 ssh 連接請(qǐng)求。
我的一臺(tái)樹(shù)莓派IP是:192.168.59.133任何服務(wù)器使用任何用戶(hù)ssh均報(bào)錯(cuò),甚至連自己都不能ssh自己。
不能使用任何工具連接上該服務(wù)器
使用ssh連接自己的127.0.0.1和localhost都權(quán)限拒絕錯(cuò)誤
ssh報(bào)錯(cuò)如下
任何服務(wù)器ssh報(bào)錯(cuò)內(nèi)容均一樣:報(bào)錯(cuò)內(nèi)容均為:
Permission denied, please try again.
檢查列表
sshd服務(wù)是否正常開(kāi)啟
sudo systemctl status ssh
關(guān)閉防火墻
sudo ufw enable
嘗試sudo ufw enable,從我的win7系統(tǒng)ssh登錄不上虛擬機(jī)。但是在本機(jī)上ssh 192.168.14.83可以登錄成功
SSH兩種身份驗(yàn)證
SSH實(shí)現(xiàn)身份驗(yàn)證,有兩種:
基于密碼的安全驗(yàn)證
基于密鑰的安全驗(yàn)證
允許root用戶(hù)登錄+允許root用戶(hù)登錄 - 基于密碼的安全驗(yàn)證
SSH遠(yuǎn)程連接時(shí)無(wú)法直接通過(guò)root賬戶(hù)登錄,會(huì)顯示權(quán)限不足(Permission denied, please try again.)
要開(kāi)啟root賬戶(hù)遠(yuǎn)程登錄,要找到/etc/ssh/sshd_config
?文件并修改其中的設(shè)置
#sudo vim /etc/ssh/sshd_config
找到并用#注釋掉這行:PermitRootLogin prohibit-password
PermitRootLogin yes #允許root登錄,設(shè)為yes。
PermitRootLogin prohibit-password #允許root登錄,但是禁止root用密碼登錄
重啟 SSH 服務(wù)生效
systemctl restart ssh
can't open /dev/tty: No such file or directory
root@192.168.2.50's password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such file or directory
https://blog.csdn.net/cuichongxin/article/details/117462494文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-813302.html
ssh兩種認(rèn)證方式的原理
https://blog.csdn.net/marywang56/article/details/83621738文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-813302.html
到了這里,關(guān)于用戶(hù)ssh正確密碼登陸樹(shù)莓派鏡像均報(bào)錯(cuò)Permission denied, please try again.處理方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!