一、查看主目录权限对不对

1:问题描述
[root@ser6-52 ~]# su - mongodb
su: warning: cannot change directory to /home/mongodb: Permission denied
-bash: /home/mongodb/.bash_profile: Permission denied
 
2:出错原因
家目录的属主不对,权限不够
[root@ser6-51 ~]# ls -ld /home/mongodb/
drwx------ 2 504 504 4096 Jul 15 13:50 /home/mongodb/

3:解决办法
修改owner,修改权限
[root@ser6-51 ~]# chown -R mongodb:mongodb /home/mongodb/
[root@ser6-51 ~]# chmod -R 755 /home/mongodb/
[root@ser6-51 ~]# su - mongodb
[mongodb@ser6-51 ~]$ 
 现在可以切换了。ls -ld /home/mongodb/

二、查看

其实就是用root修改一下/etc/sysconfig/selinux,将SELINUX=targeted修改为SELINUX=permissive

三、修改一下etc目录的权限

chmod -R 755 /etc

su: warning: cannot change directory to : Permission denied ;-bash: bash_profile: Permission denied的更多相关文章

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

    用root帐号切换其他帐号提示: 出错原因: 基本上是根目录或者是/home/oracle目录权限的问题 解决办法: 更改根目录权限为755,并保证对应用户主目录的所属用户和所属组一致和用户名一致. ...

  2. Linux切换用户时报错/.bash_profile: Permission denied,命令行(终端提示符)出现-bash-4.2$

    Linux切换用户时报错/.bash_profile: Permission denied,命令行(终端提示符)出现-bash-4.2$ 利用su - 切换用户时,发现有一个用户切时出现如下情况 [r ...

  3. 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 ...

  4. 【Mac 10.13.0】安装 libimobiledevice,提示报错:warning: unable to access '/Users/lucky/.config/git/attributes': Permission denied解决方案

    打开终端,执行命令: 1.sudo chown -R XXX /usr/local  (XXX表示当前用户名) 2.ruby -e "$(curl -fsSL https://raw.git ...

  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. 解决ubuntu bash: cd: ~:Permission denied

    cd /usr/local/hadoop 报错:bash: cd: /usr/local/hadoop:Permission denied 输入指令: /usr/local/hadoop 原因是没有权 ...

  7. github多用户git push错误remote: Permission to user1/z.git denied to user2

    背景:同一台电脑的public key同时添加到了github的两个账户,导致user1的仓库没法正常提交. 解决办法:为两个账户分别配置ssh key,配置~/.ssh/config文件(windo ...

  8. Bash . configure permission denied错误

    当你在Linux(我这里是Ubuntu10.04LTS Desktop)下编译安装某个包的时候,你首先是进入到解压目录然后执行“$ ./configure”的,但是有时候你会发现提示错误,错误提示是这 ...

  9. 【linux】 解决linux下vsftp 500 OOPS: cannot change directory:/home/ftp/ 办法

    用FileZilla连接ftp出现错误,500 OOPS: cannot change directory:/home/ftp 原因是CentOS系统安装了SELinux,因为默认下是没有开启FTP的 ...

随机推荐

  1. POJ-3134-Power Calculus(迭代加深DFS)

    Description Starting with x and repeatedly multiplying by x, we can compute x31 with thirty multipli ...

  2. Xilinx-7Series-FPGA高速收发器使用学习—概述与参考时钟篇

    xilinx的7系列FPGA根据不同的器件类型,集成了GTP.GTX.GTH以及GTZ四种串行高速收发器,四种收发器主要区别是支持的线速率不同,图一可以说明在7系列里面器件类型和支持的收发器类型以及最 ...

  3. VS2017 - Winform 简单托盘小程序

    界面比较简单,主要两个button 一个NotifyIcon 和 右键菜单 控件, NotifyIcon 属性,如下: 并为NotifyIcon指定了DoubleClick事件: 主窗体增加两个事件: ...

  4. 【转载】Highcharts使用指南

    另附几个较好的图形组件库: 基于HTML5的开源画图组件:http://www.ichartjs.com/gettingstarted/ 图表Echarts: http://echarts.baidu ...

  5. InputArray和OutputArray

    源码路径:~/opencv-2.4.9/modules/core/include/opencv2/core/core.hpp where _InputArray is a class that can ...

  6. spring boot 打包报错

    [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.0.RELEASE:repac ...

  7. codeforces624b Making a String

      Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status De ...

  8. IPBX和话机对接

    某厂家的话机和IPBX进行对接问题: 1.      该话机作为主叫方,呼叫能够正常建立 2.      该话机作为被叫方.呼叫无法建立,IPBX发送INVITE消息给该话机,该话机回复400 具体消 ...

  9. .net版本和操作系统

    转自: http://msdn.microsoft.com/zh-cn/library/bb822049(v=vs.110).aspx 服务器操作系统 包括 还可以安装 Windows Server ...

  10. [搬家]新域名 akagi201.org

    现在感觉自己做了好多年的垃圾信息制造者 以后只在网络上发布有用的东西, 垃圾或者对别人没用的东西就放到自己的硬盘上把 http://akagi201.org