Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
2  
Yes I got that, I know the trick. But how does this work? Why can't I set just 766? –  OrangeTux Jun 25 '12 at 22:37

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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