Using the Reflection FTP Client to Change UNIX File Permissions
Technical Note 1171
Last Reviewed 12-May-2005
Applies To
Reflection FTP Client version 10.0 or higher
Summary
Changing the attributes for server file permissions is not a standard part of the FTP protocol and cannot be performed through the Reflection FTP Client graphical interface. However, some UNIX FTP servers have extended SITE commands that allow you to use the umask command to set the file attributes for new files or the chmod command to set the file attributes for existing files. This technical note describes how to use those commands to set or change file attributes from within the Reflection FTP Client.
Confirming That Umask and Chmod Commands Are Supported
Follow these steps to see if the umask and chmod commands are supported by the server:
- Using the Reflection FTP Client, establish a connection to your host.
- Click View, Command Window.
- Type quote site help or quote help site in the Command Window. The command varies depending on the server.
- Check whether CHMOD and UMASK are listed in the output. If they are present, proceed to the remaining sections of this note. If they are not present, your server does not support these commands, and you cannot use the Reflection FTP Client to set file attributes.
For more information on chmod and umask commands, see your UNIX man pages.
Setting Attributes of Existing Server Files
The steps you follow to change attributes of existing UNIX FTP server files depend on the version of Reflection FTP Client you are using.
Version 13.0
Follow these steps to use the Reflection FTP Client graphical interface to change UNIX file permissions:
- Right-click the desired server file or directory (or select and right-click multiple files or directories). Click Properties.
- Use the check boxes to set Owner, Group, and Public attributes. (Alternatively, you can enter a three digit number for Permission Mask, which is calculated as described in the Calculating Chmod Numeric Values section below.) Click OK.
Version 12.0 or earlier
Follow these steps to use the chmod command to change UNIX file permissions:
- Calculate the octal value for the desired file attributes as described in the Calculating Chmod Numeric Values section below.
- In the Reflection FTP Client Command Window, type quote site chmod <mode> <filename>. The value for <mode> is the three-digit octal value calculated in Step 1.
Note: Changes made to directories are not recursive; that is, they do not affect the files or subdirectories within the directory.
Setting Default Attributes for New Server Files
Follow these steps to set default read, write, and execute rights for new files you will upload to the server:
- Calculate the octal value for the attributes you wish to set. Refer to the Calculating Chmod Numeric Values section.
- Calculate the mask by subtracting the value derived in Step 1 from 777. For example, 777-664=113.
- In the Reflection FTP Client Command Window, type quote site umask <nnn>. The value for <nnn> is the umask value calculated in Step 2.
- Upload files as usual. New files will be created with the desired attributes.
Note: Typically, if you specify umask execute attributes, they will only be set for new directories you create. Use the chmod command to set execute attributes for files.
Using the Reflection FTP Client to Verify File Attributes
There are two ways to verify file attributes with the Reflection FTP Client.
Viewing File Properties
- Right-click the desired file. Select Properties.
- On the General tab, the Attributes are listed at the bottom.
Viewing File Details
- Connect to your host.
- From the View menu, select Right Pane or Sever Pane(s), then Details. You may need to use the horizontal scroll bar to view the file attributes.
Calculating Chmod Numeric Values
Some of the procedures in this technical note require calculating the chmod octal "mode" value. This is calculated by adding the values shown in the following table.
User
|
Rights
|
Attribute
|
Octal Value
|
Owner
|
read by owner
|
r
|
400
|
|
write by owner
|
w
|
200
|
|
execute (search in directory) by owner
|
x
|
100
|
Group
|
read by group
|
r
|
040
|
|
write by group
|
w
|
020
|
|
execute/search by group
|
x
|
010
|
Other
|
read by others
|
r
|
004
|
|
write by others
|
w
|
002
|
|
execute/search by others
|
x
|
001
|
For example, the octal value for rw-rw-r-- rights is 664 (400+200+40+20+4=664).
Related Technical Notes
| 1176 |
Reflection FTP Client Technical Notes |
| 1178 |
Understanding UNIX and NFS Permissions |
| 1188 |
Basic Troubleshooting for the Reflection FTP Client |