適用情形:
1.使用ssh遠程連接,remote等出現permission denied,please try again。
2.使用final shell等軟件登陸時,密碼已經正確卻一直讓重輸密碼。
3.一個賬號可以登陸,另外一個賬號不可登陸(多爲新賬號)
4.普通用戶可登陸,root用戶無法登陸(見方法一)
正文:
解決方法一、解決root和普通用戶
1.配置/etc/ssh/sshd_config
sudo gedit /etc/ssh/sshd_config
將PermitRootLogin 後面改爲yes,同時去掉PasswordAuthentication yes前的#
2.重啓ssh服務
service ssh restart
解決方法二、之前有更改過home文件夾,導致當前用戶沒有讀寫權限
1.更改權限
sudo chmod +x /home/
2.重啓ssh服務
/etc/init.d/sshd restart (提示沒有該文件則用/etc/init.d/ssh restart)
解決方法三、直接重裝ssh(親測有用)
1.卸載ssh相關包
sudo apt-get remove openssh-server openssh-client --purge && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get update
2.重裝ssh
sudo apt-get install openssh-server openssh-client
如有疑問請在評論區留言,如有幫助麻煩右上角點個贊~~蟹蟹(*^▽^*)~