I just created a new user, and I want to give access to a folder.
I have done:
chmod -R 777 ./p
and this is the result
lisa@linux:/media$ ls -halt
drwxr-xr-x 27 root root 4,0K dic 11 11:57 ..
drwxrwxrwx+ 3 pierpaolo utenti 4,0K dic 8 23:48 p
drwxr-xr-x 3 root root 4,0K set 10 12:20 .
lrwxrwxrwx 1 root root 45 ago 5 01:22 .directory -> /etc/kubuntu-default-settings/directory-media
But still, i can not cd in to the folder (permission denied). Any idea how to approach this problem or debug it?
Edit:
getacl gives:
# file: p
# owner: pierpaolo
# group: utenti
user::rwx
user:pierpaolo:r-x
group::---
mask::rwx
other::rwx
Edit:
The folder i want to access by the new user is a second hard disk that has been mounted in /etc/fstab using the following command:
UUID=FEB222A8B222657D /media/p/Seagate ntfs-3g defaults,windows_names,locale=it_IT.UTF-8 0 0
Best Answer
This happens because there is a directory higher in the tree where you do not have execute permission. If a parent directory has no execute permission for some user, then that user cannot stat any subdirectories regardless of the permissions on those subdirectories.
Example:
Even though I am the owner of the directory 'brownies' and all users have permission to read and enter it, I can't access it if its parent directory has no execute permission.
It's better to use groups to manage permissions than give to give directories 777 permission.