I installed vsftpd and configured SFTP.

I have a standard user who is named, let's say, user1 with all perms. I don't want to give the password to my friend. I only want him to access a specific directory to upload files so server can run them.

The file place is : /home/user1/upload

I created a user, with no shell login, named user1ftp. I changed the user home location to /home/user1/upload so when he logs in, he directly logs into the upload directory. He can upload and delete files in it.

The problem is that when he uploads a file, the server cannot run it. His files' permission are: rw-r--r--

I need to make sure that when he uploads a file, the permissions are rwxrwxr-x

These users are members of the same group.

How can I do that?


The feature you are looking for is called the umask. That feature removes permissions from a permission-setting.

Setting a umask to zero (0) turns it completely off. If you set it to 2, that will turn off only the "w' flag near the end of the permissions. According to the discussion (see below), if you do this, vsftpd can allow the rwxrwxr-x that you are trying to achieve.

There are two settings in vsftpd's configuration file (perhaps /etc/vsftpd.conf).

  • local_umask (the one you want)
  • anon_umask (for anonymous users)

Further reading:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.