chmod help
I have a large directory with about 60GB worth of subdirectories and files beneath it. I would like only root to have access to delete anything in that directory, while any user can read the files (say mp3's and I want any user to be able to play them). I keep thinking
Code:
chmod -R 644 /foo/bar Since the directory in question is a subdirectory, do I need to give the same permissions all the way up the tree? is that where I'm making my mistake? |
Hi,
your mistake is that a directory must be executable in order to access it. You'll have to give 644 to all files but 755 to all directories. Markus |
If you want to traverse subdirectories you need something like
Code:
chmod -R u=rwX,go=rX /foo/bar |
Hi
-rw-r--r-- user.group.all First you need to changed the owner to root chown -R root.root /foo/bar then remove write access of other user chmod -R 745 /foo/bar 7 means only root can read write or execute 4 groups can only read 5 all user can read and execute I hope that will help |
All times are GMT -5. The time now is 10:21 AM. |