chmod - Change file permissions and modes in SFTP

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

Syntax:
psftp> chmod modes filename


The modes parameter can be a set of octal digits in the Unix style.

Example:
psftp> chmod 777 file1.sh


The above code grants read, write, execute permissions to everybody for the file1.sh.

Example:

psftp> chmod go-rwx,u+w file.sh
psftp> chmod a+r file.sh


r- read
w-write
x-execute

+ symbol gives the permissions mentioned and - symbol revokes the permissions.

g- group of users
o,a - all
u- own user

So, in the above code
chmod go-rwx,u+w file.sh --> revokes all permissions from group users, all and gives write permission for the own user.
chmod a+r file.sh --> gives read permission to all