Score:2

FTP restricted user umask - where is it?

cn flag

I've studied this for days and I cannot find the solution. I have 2 ftp users. Settings in /etc/vsftpd.conf:

write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES

The shell that this user logs into is /bin/ftponly. The code is:

#!/bin/sh
echo "This account is limited to FTP access only."
#!/bin/sh
echo "This account is limited to FTP access only."

The user is restricted to an ftp shell and cannot open terminal.

When a user (ex deanhh) uploads a NEW file the permissions are: -rw------- 1 deanhh deanhh 118 Jan 3 19:48 testfile This looks like umask for the user (deanhh) is 0077 correct?

I cannot find where this is being set. I've looked at:
/etc/vsftpd.conf
/etc/login.defs
/home/deanhh/.bashrc
/home/deanhh/.profile

None of these files set that umask. Also, the 'home' directory for deanhh is /var/www/deanhh.com not /home/deanhh (which does exist) There are no files or subfolders in /var/www/deanhh.com to indicate the umask or any user settings.

How can I determine where umask is being set for ftp users (namely deanhh)?

Score:1
cn flag

You set it in /etc/vsftpd.conf.

In case you are wondering about the current permissions: the local_umask setting defaults to 077, disabling groups and others to access files in any way (as you already noticed).

Several options you can have for user auth:

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=0002
anon_upload_enable=YES
anon_mkdir_write_enable=YES
file_open_mode=0777
  • file_open_mode sets the default setting of files. 777 sets it readable, writeable and executable for anyone. With local_umask set to 002, this gives you 775.
kristy1024 avatar
cn flag
THANK YOU I couldn't find it because it didn't exist - it was the default. I changed it in /etc/vsftpd.conf as you suggested and now it works correctly.
Fabby avatar
id flag
**@kristy1024** If that works for you don't forget to come back and click the grey check mark below the answer turning it a beautiful green. **Rinzwind:** <10K and you'll be [#1](https://askubuntu.com/users?tab=Reputation&filter=all)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.