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

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

 2 years ago davidzhang

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

时间: 2024-11-12 17:02:35

Could not chdir to home directory /home/USER: Permission denied的相关文章

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

Could not chdir to home directory /home/nomiji: Permission denied1.[我们要远程nomiji用户][[email protected] ~]# ssh [email protected][email protected]'s password: Last login: Mon Aug 13 21:18:55 2018 from shell.comCould not chdir to home directory /home/nom

用root帐号切换其他帐号提示 su: warning: cannot change directory to /home/oracle: Permission denied

用root帐号切换其他帐号提示: 出错原因: 基本上是根目录或者是/home/oracle目录权限的问题 解决办法: 更改根目录权限为755,并保证对应用户主目录的所属用户和所属组一致和用户名一致. 示例: --本篇文章转自http://blog.csdn.net/jack161641/article/details/7090490 用root帐号切换其他帐号提示 su: warning: cannot change directory to /home/oracle: Permission d

centos7数据库连接使用127.0.0.1报permission denied,使用localhost报No such file or directory

安装lamp环境后,测试数据库连接. 当host使用127.0.0.1时,报错:(HY000/2002): Permission denied. 把host换成localhost后,又报错:SQLSTATE[HY000] [2002] No such file or directory. 最后发现是因为没有关闭selinux,通常情况下载安装完CentOS7后,默认情况下SElinux是启用状态. [[email protected] ~]# sestatus SELinux status: e

centos:解决docker容器内挂载目录无权限 ls: cannot open directory .: Permission denied

docker运行一个容器后,将主机中当前目录下的文件夹挂载到容器的文件夹后 进入到docker容器内对应的挂载目录中,运行命令ls后提示: ls: cannot open directory .: Permission denied 解决: 在docker run一个容器时,加上 --privileged=true 给容器加特权即可. 原文地址:https://www.cnblogs.com/UniqueColor/p/9318815.html

ls: cannot open directory .: Permission denied

问题:ls: cannot open directory .: Permission denied 解决:说明当前用户没有执行该命令的方法,需要命令前加sudo 原文地址:https://www.cnblogs.com/saifei1125/p/12129307.html

docker ls: cannot open directory .: Permission denied

down vote From access.redhat.com:Sharing_Data_Across_Containers: " Host volume settings are not portable, since they are host-dependent and might not work on any other machine. For this reason, there is no Dockerfile equivalent for mounting host dire

docker 容器挂载主机目录,访问出现 cannot open directory /mnt/home/webroot/: Permission denied 的解决办法

问题原因及解决办法 原因是CentOS7中的安全模块selinux把权限禁掉了,至少有以下三种方式解决挂载的目录没有权限的问题: 1.在运行容器的时候,给容器加特权,及加上 --privileged=true 参数: docker run -i -t -v /soft:/soft --privileged=true 686672a1d0cc /bin/bash 2.临时关闭selinux: setenforce 0 3.添加selinux规则,改变要挂载的目录的安全性文本

CentOS创建账号无法登陆

CentOS测试,创建jack账号,删除时只使用userdel jack,没加参数 账号删除成功,但是对应的home文件夹/home/jack并没有删除. 重新创建账号,设置密码,尝试登陆,提示以下错误: Last failed login: Wed Mar  8 14:05:39 CST 2017 from 10.15.105.20 on ssh:notty There were 8 failed login attempts since the last successful login.

hadoop无法启动常见原因

1.Could not chdir to home directory /home/USER: Permission denied 启动datanode时会报这个错误,尝试利用ssh登录datanode,发现需要密码.解决办法: 利用root权限修改/etc/sysconfig/selinux,将SELINUX修改为permissive. 如果不想重启机器来使配置起作用,可以利用root权限直接执行 setenforce permissive 待续……   hadoop无法启动常见原因