Could not chdir to home directory /home/nomiji: Pe

Could not chdir to home directory /home/nomiji: Permission denied
1.[我們要遠程nomiji用戶]
[root@shell ~]# ssh [email protected]
[email protected]'s password:
Last login: Mon Aug 13 21:18:55 2018 from shell.com
Could not chdir to home directory /home/nomiji: Permission denied
-bash: /home/nomiji/.bash_profile: Permission denied

2.這種報錯是對方的用戶的家目錄 裏的.bash_profile 的擁有者和所屬組 的問題
【ls -la 我們可以看到.bash_profile的擁有者和所屬組 都是cat 而不是nomiji】
[root@openresty nomiji]# ls -la
total 16
drwx------. 2 cat cat 83 Aug 13 21:17 .
drwxr-xr-x. 4 root root 31 Aug 13 21:18 ..
-rw-------. 1 cat cat 5 Aug 13 21:17 .bash_history
-rw-r--r--. 1 cat cat 18 Apr 10 20:53 .bash_logout
-rw-r--r--. 1 cat cat 193 Apr 10 20:53 .bash_profile
-rw-r--r--. 1 cat cat 231 Apr 10 20:53 .bashrc

3.修改家目錄的擁有者和所屬組
chown -R nomiji:nomiji /home/nomiji/
此時遠程登錄就OK了

-bash: /home/nomiji/.bash_logout: Permission denied
Connection to 192.168.122.84 closed.
[root@shell ~]# ssh [email protected]
[email protected]'s password:
Last login: Mon Aug 13 21:20:32 2018 from shell.com
[nomiji@openresty ~]$ whoami
nomiji

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章