代码改变世界

Could not chdir to home directory /home/USER: Permission denied

2015-08-12 17:23  夏洛克·福尔摩斯  阅读(8055)  评论(0编辑  收藏  举报

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 permissive

You can check if set correctly
#getenforce

 

上面就是解决的办法

其实就是修改一下/etc/sysconfig/selinux

将SELINUX修改为permissive

如果不想重启机器来使配置起作用,可以直接执行

setenforce permissive

如果没有实现,先确定一下是否是root权限

This entry was posted in Linux and tagged chdir Permission