現象描述
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
1、grep username /etc/passwd查看username屬性與正常登錄的用戶進行對比發現username默認登錄shell為/bin/sh,其他正常用戶為/bin/bash
2、usermod -s /bin/bash username
驗證結果
再次使用ssh登錄linux出現心儀已久的提示符以及報錯提示已消除username@localhost:~$