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

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

  1. zzw原创_解决Could not chdir to home directory /test/bdctool: Permission denied一例

    1.用命令新建一用户 adduser -d /test/bdctool  -m bdctool 2.用新用户登录,报错:Could not chdir to home directory /test/ ...

  2. 非root用户启动redis容器报错mkdir: cannot create directory '/bitnami/redis': Permission denied

    问题:使用docker启动容器时,报错如下 zh@debian:~/testPath$ docker-compose up redis Starting testpath_redis_1 ... do ...

  3. 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后,又报错:SQLST ...

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

    docker运行一个容器后,将主机中当前目录下的文件夹挂载到容器的文件夹后 进入到docker容器内对应的挂载目录中,运行命令ls后提示: ls: cannot open directory .: P ...

  5. hadoop3: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs’: Permission denied

    1.hadoop3: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied把所有Datan ...

  6. su: warning: cannot change directory to : Permission denied ;-bash: bash_profile: Permission denied

    一.查看主目录权限对不对 1:问题描述 [root@ser6-52 ~]# su - mongodb su: warning: cannot change directory to /home/mon ...

  7. tomcat 403错误和ls: cannot open directory '.': Permission denied

    在centos7 linux系统上使用docker进行tomcat部署项目测试的时候发现第一个错误:浏览器返回403 错误,显然是一个权限问题,禁止访问.下面是我一步一步的操作: 1 使用的docke ...

  8. mkdir: cannot create directory ‘/soft/hadoop-2.7.3/logs’: Permission denied问题

    启动hadoop时,报错“mkdir: cannot create directory ‘/soft/hadoop-2.7.3/logs’: Permission denied” 注:/soft/ha ...

  9. docker cannot open directory .: Permission denied无权限问题

    docker运行一个容器后,将主机中当前目录下的文件夹挂载到容器的文件夹后 进入到docker容器内对应的挂载目录中,运行命令ls后提示: ls: cannot open directory .: P ...

随机推荐

  1. 360春秋杯CTF比赛WRIteUP

    题目:where is my cat? 地址:http://106.75.34.78 访问网页出现证书错误的问题,查看证书如下: 抓包发现: Accept-Encoding: gzip, deflat ...

  2. 在Android中使用枚举注解而不是枚举

    Enums often require more than twice as much memory as static constants. You should strictly avoid us ...

  3. php基本函数

    //1.随机数和时间 //echo rand(); 随机数生成器,生成随机数 //echo rand(a,b); 生成a~b之间的随机数 //echo time(); 生成当前的Unix时间戳 //e ...

  4. 用Redis实现优先级队列

    在最近在面试过程中,张先森遇到一个面试官这么问,如果一个并发很大的消息应用,想要根据请求的优先级来处理,该怎么做.我当时只是笼统地回答用redis,面试官点了点头,这个问题就此通过. 那么用redis ...

  5. Tuple元组 C#

    使用元组, 一些简单的结构或对象就不需要新建一个类了. https://msdn.microsoft.com/zh-cn/library/system.tuple.aspx

  6. JS中的函数、BOM和DOM操作

     一.JS中的函数 [关于注释] /** [文档注释]:开头两个*.写在函数上方,在调用函数时可以看到文档上方的描述信息. */   // 单行注释 /* 多行注释 */ 1.函数的声明及调用 (1) ...

  7. SoapUI进行接口测试,怎么应对接口地址总是变化!

    如果是没有代码能力的小白,要利用工具进行接口测试的时候,经常会遇到接口地址或者接口参数变化的问题,然后不得不在他们改了接口之后,就手动去改所有的请求链接地址和接口参数!1-5个请求,我们手动改还应付的 ...

  8. 在Intellij IDEA中使用Debug

    Debug用来追踪代码的运行流程,通常在程序运行过程中出现异常,启用Debug模式可以分析定位异常发生的位置,以及在运行过程中参数的变化.通常我们也可以启用Debug模式来跟踪代码的运行流程去学习三方 ...

  9. Tomcat启动:Container StandardContext[] has not been started

    Container StandardContext[] has not been started\root.xml 初始化失败,检查数据源配置

  10. linux bash 和 sh的区别

    详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt189 Linux 中的 shell 有很多类型,其中最常用的几种是: Bou ...