Skip to main content
Seaport
Gold ⭐️
May 10, 2019 10:49 PM UTC
Solved

Directory read permission setting does not work

I use chmod to give others the read permission on the home/maria_dev directory. However, the user hive still cannot read the directory.

[maria_dev@sandbox-hdp ~]$ ls -ld
drwx---r-- 1 maria_dev maria_dev 4096 Mar  5 05:35 .
[maria_dev@sandbox-hdp ~]$ sudo su hive
[hive@sandbox-hdp maria_dev]$ ls
ls: cannot open directory .: Permission denied


gul_shad
gul_shadAnswer
Gold ⭐️
May 13, 2019 1:21 AM UTC

You must provide read and execute (r-x) permissions to others.


Try this

$ chmod 705 /home/maria_dev
$ sudo su hive

$ ls -l /home/maria_dev

4 replies

Shelton
Gold ⭐️⭐️⭐️
May 12, 2019 2:05 PM UTC

@Haijin Li

I think there is a problem with your command the - (hyphen) is missing can you copy and paste the below

$ sudo su - hive

Please revert

Translate
Seaport
SeaportAuthor
Gold ⭐️
Jun 15, 2019 5:04 AM UTC

@Geoffrey Shelton Okot

My intention is to use "su hive", not "su - hive".

Below is the resource showing the difference.

https://www.tecmint.com/difference-between-su-and-su-commands-in-linux/

Thanks.

Translate
gul_shad
Gold ⭐️
gul_shadAnswer
Gold ⭐️
May 13, 2019 1:21 AM UTC

You must provide read and execute (r-x) permissions to others.


Try this

$ chmod 705 /home/maria_dev
$ sudo su hive

$ ls -l /home/maria_dev

Translate
Seaport
SeaportAuthor
Gold ⭐️
Jun 15, 2019 4:57 AM UTC

@Gulshad Ansari

Thanks. You are right. The execute permission is required for entering the directory.

Translate