Using the Reflection FTP Client to Change UNIX File Permissions

  • 7021982
  • 30-Mar-2000
  • 02-Mar-2018

Environment

Reflection FTP Client version 14.0.7 or higher

Situation

This note describes how to use the Reflection FTP Client to view and set file permission attributes for new or existing files.

Resolution

Confirming umask and chmod Commands Are Supported

Some of the procedures in this note use the UNIX chmod and umask commands. Follow these steps to see if the umask and chmod commands are supported by your server:

  1. Using the Reflection FTP Client, establish a connection to your host.
  2. Click View, Command Window.
  3. Type quote site help or quote help site in the Command Window. The command varies depending on the server.
  4. 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

You can set attributes using the user interface or the chmod command.

Setting Attributes Using the User Interface

To use the Reflection FTP Client graphical interface to change UNIX file permissions:

  1. Right-click the desired server file or directory (or select and right-click multiple files or directories). Click Properties.
  2. 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.

Setting Attributes Using the chmod Command

Follow these steps to use the chmod command to change UNIX file permissions:

  1. Calculate the octal value for the desired file attributes as described in the Calculating chmod Numeric Values section below.
  2. 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 Attributes for New Server Files

There are several ways to set attributes for newly created server files.

Setting Attributes for Newly Created Files Using the User Interface

Use any of these options in the FTP Client user interface to determine how the client handles attributes for uploaded files:

  • To set default attributes for all uploads use Tools > Options > Attributes > Set default attributes on uploads.
  • To be prompted for file permission attributes each time you upload a file to a site, use Site Properties > Transfer tab > Show upload options before transfer.
  • If your server supports umask, you can set an Initial umask value in Site Properties > Connection tab. Refer to the Calculating chmod Numeric Values section and subtract the chmod value from 777 to determine the mask value. For example, 777-664=113. Note: This umask option is not available for SFTP connections.

Setting Attributes for Newly Created Files Using the umask Command

Follow these steps to use the umask command to set default read, write, and execute rights for new files you will upload to the server:

  1. Calculate the octal value for the attributes you wish to set. Refer to the Calculating chmod Numeric Values section.
  2. Calculate the mask by subtracting the value derived in Step 1 from 777. For example, 777-664=113.
  3. In the Reflection FTP Client Command Window, type quote site umask <nnn>. The value for <nnn> is the umask value calculated in Step 2.
  4. 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.

Viewing Attributes of Existing Server Files

In Reflection FTP Client, there are two ways to check attributes of existing files.

File Properties

  1. Right-click the desired file. Select Properties.
  2. On the General tab, the Attributes are listed at the bottom.

File Details

  1. Connect to your host.
  2. From the View menu, select Right Pane or Sever Pane(s), then Details. You may need to resize the window or 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).

Tip: You can also use the server file Properties dialog box to determine chmod octal values as well as to modify server file permissions. Right-click any server file to display this dialog box. The dialog box includes check boxes for setting Owner, Group, and Public permissions. As you select and unselect options, the octal value for the currently selected permissions displays in the Permission Mode text box.

Additional Information

Legacy KB ID

This article was originally published as Attachmate technical note 1171.