Change umask of Directories/Files Created via FTP
As per the default umask settings all the directories created have 755 permission, umask:022.
As per the default umask settings all the files created have 644 permission, umask:133.
If you really want to change the umask of Directories/Files Created via FTP, you have to follow the steps shown below.
By default Kloxo is using pureftp as ftp server and xinetd as daemon to start the ftp service.
In kloxo pureftp service configuration file is located in /etc/xinetd.d/
==============================================================================================
# cat /etc/xinetd.d/pureftp
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/pure-ftpd
server_args = -A -c5000 -C8 -D -fftp -H -I15 -lpuredb:/etc/pure-ftpd/pureftpd.pdb -lunix -L2000:8 -m4 -s -p30000:50000 -U133:022 -u100 -Oclf:/var/log/kloxo/pureftpd.log -g/var/run/pure-ftpd.pid -k99 -Z -Y 1
groups = yes
flags = REUSE
}
==============================================================================================
You have to change the values in the following line of the configuration.
server_args = -A -c5000 -C8 -D -fftp -H -I15 -lpuredb:/etc/pure-ftpd/pureftpd.pdb -lunix -L2000:8 -m4 -s -p30000:50000 -U133:022 -u100 -Oclf:/var/log/kloxo/pureftpd.log -g/var/run/pure-ftpd.pid -k99 -Z -Y 1
UMASK ---> -U133:022
| |
| |---->Directory's UMASK
|--------> Files's UMASK
If you want to set direcory's permission to 777 and files's permssion to 666, the chnages will be as like follows.
server_args = -A -c5000 -C8 -D -fftp -H -I15 -lpuredb:/etc/pure-ftpd/pureftpd.pdb -lunix -L2000:8 -m4 -s -p30000:50000 -U111:000 -u100 -Oclf:/var/log/kloxo/pureftpd.log -g/var/run/pure-ftpd.pid -k99 -Z -Y 1
Verify the result by creating a directory using FTP.
Note:
If there isn't any changes in permissions after you doing the above steps, you may need the following too.
Change the following line in /etc/pure-ftpd/pure-ftpd.conf file.
Umask 133:022
That's it...