Setting permissions for SFTP transfer (during transfer, not after)

Amedee Van Gasse (ub) amedee-ubuntu at
Wed Feb 24 12:23:21 UTC 2010

On Wed, February 24, 2010 12:48, Ben Edwards wrote:
> When I SFTP a file onto a box I get the permissions -rw-r--r--, but I
> want the permissions -rw-rw----. For security reasons I don't want to
> transfer the file then change the permissions, I want the file to have
> the permissions from when it first exists. To specify the requirement
> a bit more formally:
> "To enable a user to SFTP a files onto a box with the permissions set
> to user and group readwrite and no access to world. These permissions
> must be set at the beginning of the transfer (rather than after using
> chmod). This is to ensure users can not read, change or delete the
> file at any time (during or after the transfer)."
> This can either be done as a SFTP set-up of something the user does
> when transferring the files.
> any Ideas?

What is your umask? Umask sets the default permissions for new files.

More information about the ubuntu-users mailing list