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=YESThe 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 testfileThis 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)?
1 Answer
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=0777file_open_modesets the default setting of files.777sets it readable, writeable and executable for anyone. Withlocal_umaskset to002, this gives you775.