home  UNIX SPECIFIC  : Understanding File Permissions 
Web and Email Hosting
More Information about our Web and Email Hosting Solution. Linux Web HostingWindows

Understanding File Permissions

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.

User types

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.

The Permissions

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.

Reading File Permissions

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.

Using Your FTP Client

Upon connecting to your account via an FTP client, you'll see a directory listing such as this:

A directory listing in CuteFTP showing file permissions.

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:

A directory listing in PuTTY, a Telnet/SSH client, showing file permissions.

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.

Changing Permissions

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.

* Note: Not all FTP clients display or allow you to modify the attributes for files and directories.

Related Items

Email and Web Hosting by Internet Connection 2004-2007 ©
Contact IC Support via AIM!  Our SN is ICSupportDesk