How do I view/change permissions on files/directories?
There are 3 different attributes a file can have that make up the permissions for the file.
There is read access that allows users to read the file.
There is write access that allows users to modify the file.
There is executable access that allows users to execute the file.
From these three attributes, you now have three different levels of permissions, the first being for the owner of the file, the second being for the group the file belongs to and the third being all other users on the system.
To view the current permissions on files and directories run the following command:
ls -l and you should see something that looks like:
drwxrwxr-x 3 joey html 4096 Sep 12 2000 images/
-rw-rw-r-- 1 joey html 267 Aug 8 12:55 index.shtml
The above shows you that images is a directory (d) and that the owner and group (joey html) have read ®, write (w) and execute (x) permissions while other users on the system only have read ® and execute (x) permissions.
For the index.shtml file, it shows joey and html as the owner and group and they both have read and write access to the file. It also shows that other users on the system only have read access. Note there is no executable permission since the file is not an executable.
To modify the permissions on a file, you either have to own it or be logged in as root. To modify the permissions, in a terminal type:
chmod xxx filename/directory
You will have to replace the xxx flags with the permissions you wish to change. You can either go by the numerical value or by the actuals. For more information, in a terminal, type man chmod
http://www.linuxhelp.ca/newbies/