stuck in file permissions
Hi
I m new in linux and have a basic query. Hope i ll get my answer here. I have made a file /depts/hr/ in root's home directory. Now changed its group ownership from 'root' to 'hr'. Also changed the file permissions of /depts/hr to 770. Now I want to access this file with ls from a user 'atul' who is also a member of 'hr' group. But when i do this i m getting error- permissioned denied. Isn't it correct that with above given permissions members of group can access the file? Then why atul is not able to? Pls guide me. |
Probably because atul is not allowed access to /root and depts/hr is within /root
If you want to set up a directory that other users have access to then do not put it in /root because no other user should have access to /root I would put the depts/hr directory in /usr/share/ and then set the permissions/ownership accordingly. |
Quote:
I assume that depts/hr is under /root then. Right? In that case, try these three commands, and look carefully the ownerships and permissions for the three commands: Code:
ls -ld /root The hint: note that to be able to reach "hr" you need to go across all the possible locations between / and that location. If there's a wall in the middle of the road then you can't pass. |
Thanks to both of you for providing valuable info. But still have doubt that if I make my file in /usr/share then it has permissions rwxr_xr_x means atul can only see the files inside but cannot create a new file. Where to make a file which is accessible to all and everyone can write.
Is /tmp OK ? |
Quote:
The read and exec permissions for directories are somewhat different on that matter, because to access a subdir you need to read the dirs that are before it on the tree. But to write into a dir, you don't need to write anything on the father dirs. So, as long as you have +rx on the previous dirs, you can allow +w on a given dir and it should work. |
All times are GMT -5. The time now is 12:27 PM. |