|
|
||||

Because Unix is a multi-user operating system, it must enforce restrictions on user access to files. This is accomplished by file permissions; each file has a set of permissions that determine who can read it, who can write to it and who can execute it.
Files have permissions specified for three types of users: owner, group, and other. The owner is often the file creator, however ownership may be changed so this is not always the case. The group is the group of users that the file is associated with, and other represents all other users.
Permissions control a user's ability to perform three actions: read, write and execute. Allowing users read access enables them to view the contents of files and directories. Granting write access enables users to modify and delete files and directories. Lastly, granting execute permissions allows files, such as CGI scripts, to be executed, or run, on the server.
Now that you have an understanding of what file permissions are, we'll go over how to read them. There are two ways you can view the permissions of the files and directories in your account, through your FTP client* and through the shell account that all of our *nix accounts come with.
Upon connecting to your account via an FTP client, you'll see a directory listing such as this:
If you connect to your account via SSH and do a list with the long list format switch, you'll a directory listing similar to this:
The fifth column, titled "Attr", of the FTP window and the first column of the SSH window show the permissions for each file and directory. For example, the permissions for the file index.html are -rw-r--r--.
If you look at the directory list again, you'll see the file myscript.pl has the following permissions: -rwxr-xr-x. Unlike index.html, this file grants every user the ability to execute it. This is essential for this file, which happens to be a Perl script, to function properly.
Just as you can view a file or directory's permissions through an FTP or SSH connection to your account, you can also modify permissions through these means.

chmod 644 filename.ext
"644" is a code that defines what permissions you want to grant for
each user. The left-most number refers to the settings for
* Note: Not all FTP clients display or allow you to modify the attributes for files and directories.
Related Items