Changes between Initial Version and Version 1 of faq/files/chmod


Ignore:
Timestamp:
Aug 27, 2008, 3:11:41 PM (17 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • faq/files/chmod

    v1 v1  
     1= How do I know if a file is world readable? How can I change that? =
     2
     3On a typicaly linux system, there are three sets of permissions:
     4
     5 * user: the permissions for the person who owns the file
     6 * group: the permissions for users who are in the group assigned to the file
     7 * other: the permissions for everyone else who has an account on the server
     8
     9Each set of permission can have three values:
     10
     11 * write access
     12 * read access
     13 * execute access
     14
     15The first two are self-explanatory. The third (execute access) has two different meanings:
     16
     17 * For a directory, it means that you can enter the directory and get details of the files in the directory
     18 * For a file, it means you can execute the file (required if the file is a program)
     19
     20If you are using [wiki:sftp an SFTP program] to access your directories, the method for will vary depending on the program you are using. If you are using WinSCP, simply right click on the file or folder and click properties. You will see the current permissions and be given an opportunity to change them.
     21
     22If you are using [wiki:secure_shell secure shell] you can change the mode of a file or directory with the `chmod` command. For example:
     23
     24{{{
     25# remove read access from others
     26chmod o-r foo.txt
     27
     28# remove read access from the group
     29chmod g-r foo.txt
     30
     31# remove read and execute from all users execpt the owner
     32chmod o-rx foo.txt
     33chmod g-rx foo.txt
     34
     35# Add read and execute access for everyone
     36chmod o+rx foo.txt
     37}}}