6.2.14 The chmod command: change permissions on remote files

PSFTP allows you to modify the file permissions on files and directories on the server. You do this using the chmod command, which works very much like the Unix chmod command.

The basic syntax is chmod modes file, where modes represents a modification to the file permissions, and file is the filename to modify. You can specify multiple files or wildcards. For example:

chmod go-rwx,u+w privatefile
chmod a+r public*
chmod 640 groupfile1 groupfile2

The modes parameter can be a set of octal digits in the Unix style. (If you don't know what this means, you probably don't want to be using it!) Alternatively, it can be a list of permission modifications, separated by commas. Each modification consists of:

So the above examples would do:

In addition to all this, there are a few extra special cases for Unix systems. On non-Unix systems these are unlikely to be useful: