SSH遠程采用普通用戶登錄linux主機報錯解決方法


現象描述

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Apr 17 09:00:35 2020 from x.x.x.x
Could not chdir to home directory /home/username: No such file or directory
/usr/bin/xauth:  error in locking authority file /home/username/.Xauthority
$ 

解決方法

Could not chdir to home directory /home/username: No such file or directory
1、使用root或者其他正常用戶登錄到Linux主機
2、切換到家目錄cd /home,使用mkdir username創建新目錄並修改屬主chown -R username:username username
/usr/bin/xauth:  error in locking authority file /home/username/.Xauthority
1grep username /etc/passwd查看username屬性與正常登錄的用戶進行對比發現username默認登錄shell為/bin/sh,其他正常用戶為/bin/bash
2、usermod -s /bin/bash username

驗證結果

再次使用ssh登錄linux出現心儀已久的提示符以及報錯提示已消除username@localhost:~$ 


免責聲明!

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



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