putty连接linux as5 输入密码后连接中断
putty連接linux as5 輸入密碼后連接中斷
1、修改putty首頁的設置,選擇“close session on exit” 為 “never”,之后發現輸入密碼后,“session closed by remote host”。
2、查看var/log/secure , 發現在每次 密碼接受 “Accepted password for root from ******* port 1897 ssh2”之后,都報了一個“fatal: bad ownership or modes for chroot directory "/usr/nginx/img/img1"”
3、初步懷疑是某文件夾權限沖突,于是匆匆的修改了這個目錄的歸屬用戶 sftp為root
4、錯誤還有,但是報錯變為 ?"bin/bash:no sucn file or directory",用無法登陸的用戶名,則報“sbin/nologin:no sucn file or directory”
由于百度得到的答案,大多集中在 shell命令的dos/unix文本格式問題,所以這一步耗費了不少時間。
?
5、問題解決,http://stackoverflow.com/questions/12619689/ssh-through-putty-comes-up-with-a-no-such-file-or-directory
“Check your?/etc/ssh/sshd_config?to make sure that you don't have a?chroot?directory set. If you do, you will need to either?create?a bin directory in the?chroot?directory and either copy or link the necessary binaries into that directory.”
注釋掉/etc/ssh/sshd_config中的chroot一行。
?
原因分析,之前在架設完服務器以后,嘗試了一把sftp,順手就按照操作說明,用chroot修改為了允許遠程用戶訪問限制在某個文件夾為根目錄上。由于SSH登陸以為該設定是根目錄,所以找不到 bin/bash。于是登陸失敗。
應該有更為完美的辦法,以后再說吧
?
?
轉載于:https://www.cnblogs.com/clarkapp/p/3277331.html
總結
以上是生活随笔為你收集整理的putty连接linux as5 输入密码后连接中断的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用SeaJS实现模块化JavaScri
- 下一篇: 处理UTF-8编码的不连续的字节流