12

I had some problems with the filepermissions when local users uploaded their files via vsftp to a server.

I wanted the files to have all 766 permissions. After a lot of trial and error I found out that I had to set the settings like this:

local_umask=011
file_open_mode=0777

But I don't know why this results in 766 permissions. Can anyone explain this?

OrangeTux
  • 348
  • 1
  • 5
  • 16

3 Answers3

18

The vsftpd daemeon will create file permissions as 0777. From that, the local_umask ( 0011 ) is subtracted. The umask essentially removes the permissions you don't want users to have. This results in the user's file permissions to be set at 0766.

For more information, see this article about file permissions.

gate_engineer
  • 421
  • 4
  • 7
Ignacio Vazquez-Abrams
  • 111,361
  • 10
  • 201
  • 247
1

The umask value is subtracted from the open mode setting. If you don't provide a custom umask value, the default one (077) is used, leading to a result you don't want.

Timo Reimann
  • 111
  • 1
  • 3
-1

You are getting this permission because:

1) Setting local_umask=011 you tell to the vsftp to set:

0: read, write and execute 1: read and write 1: read and write

That is equal to chmod 766.

2) The value of file_open_mode=0777 are not parsed,

Here you can found a very good explanation of what are umask and how to use it: https://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html