Could not chdir to home directory /home/USER: Permission denied
We changed the home folder to /data/home/USER.
When I ssh to our centos server. It shows error “Could not chdir to home directory /home/USER: Permission denied”, however loggin ok. I must manually run cd ~ to go to the home directory.
Googled around, and found it is caused by selinux. The solution:
To disabling selinux or change it from enforcing to permissive.
vi /etc/sysconfig/selinux
change SELINUX from enforcing to permissive: SELINUX=permissive, then reboot.For server could not be rebooted:
#setenforce permissiveYou can check if set correctly
#getenforce
上面就是解決的辦法
其實就是修改一下/etc/sysconfig/selinux
將SELINUX修改為permissive
如果不想重啟機器來使配置起作用,可以直接執行
setenforce permissive
如果沒有實現,先確定一下是否是root權限
This entry was posted in Linux and tagged chdir Permission