User withg owner cant access the folder nor write evcent a txt file

I have a very strange behavior. In my home/myuser I created a folder pgdata and made another user the owner using

chown user:user /home/myuser/data/pgdata

chmod 700 /home/myuser/data/pgdata

Only root user can read/write/exec. I googled and though it might be SElinux issue so I made permissive

setenforce 0

it did not help

As root, when I issue

ls -l home/myuser/data/pgdata

I see

drwx------. 3 myuser myuser 18 Apr 26 18:34 pgdata

and the folder inside it

drwx------. 20 myuser myuser 4096 Apr 26 18:32 data

So what might be missing or what might be I have done wrong? Thanks for your help

Is there a typo in your post (maybe when replacing the real user names with generic ones)? You mention you’ve made user user the owner of pgdata, but ls -l displays myuser as the owner.

FWIW, you want to grant another user access to a specific folder within your home folder, but unless you’ve granted the user user rights to traverse your home directory (execute permission), they cannot access it. It would be better to put the pgdata folder somewhere user can reach it, then grant the necessary permissions.

Yes Mike, this was a typo. And yes, you are correct your hint “to traverse your home directory…” helped me fix the problem, so many thanks

1 Like