UNIX and Linux Access Permission Bits

The numeric representation is confusing to the uninformed. File permissions in Unix and Linux permit access for "read, write, and execute" to "user, group, and other".

Two examples of detailed directory entries follow.

permissions  links    owner    group    size date   time  name

drwxr-xr-x    26      root     bin      2048 Feb 11 20:35 .
-rwxr--r--     1      root     bin     11023 Feb 10 20:25 INSTALL.linux

The first character will be a "d" if this is a directory, and a "-" if it's a file.
The next three characters can be either rwx or --- or some combination, and represent the read, write, and execute permission status for the owner of the file.  If any character is a "-" then that permission is denied.
In this example the owner is root, and has all permissions

The next three characters can also be "rwx" or "---" or any combination and represent the permissions given to the group that is associated with the file.  You have to be a member of that group for the permissions to apply.  In this example, the name of the group is bin, only read permission is granted to that group for the file INSTALL.linux.

The last three characters are like the can also be "rwx" or otherwise and refer to all other users on the computer that are  not included in either the user or group.

To convert to the numeric representation, numbers are assigned to the letters.

rwx rwx rwx
421 421 421

Adding the numbers for user, group, and other for the file INSTALL.linux yields 744.

The command "chmod 554 INSTALL.linux" would revoke write rights for the owner, add execute rights to the group, and leave the others permissions alone.

The command "chmod u-wg+x" would do the same thing, and requires no arithmetic.

After either of the commands the directory entry for INSTALL.linux would look like this.

-r-xr-xr--     1      root     bin     11023 Feb 10 20:25 INSTALL.linux

- Brian

Yes, this is the kind of fun stuff you get to do when you are actually running a 'NIX style computer. Luckily for those of us that are using Windows, WS_FTP makes this "bit wrangling" easy.

To change these access bits in WS_FTP, select the file that you want to modify on the remote system and right click on the file. A menu will pop up. Choose "chmod (UNIX)" You will then see a handy dialog box that has all the bits with checkboxes. Just check the ones that you want set and click on OK. You usually need to check all three execute boxes for Perl scripts.

You have to set these access bits each time that you upload the script. And don't forget to use the ASCII mode when transferring. Also, click on the WS_FTP "Dirinfo" button to get a UNIX style directory listing like Brian has just described.

WS_FTP is available in both "Pro" (paid) and "Lite" (free) versions. Download from here.

- Wayne