Debian – Proftpd on Debian ignoring umask setting

debian

I have found a solution for my problem. This is what I did:

I added the following to my /etc/proftpd/proftpd.conf:

<Limit SITE_CHMOD>
  DenyAll
</Limit>

I have the following problem:

When I upload files to my FTP server the umask I set is totally ignored. All files have permissions 644.

I use Debian 5.0.3 as operating system and proftpd 1.3.1 as ftp server. The user logging in is called mug and he is a local user (no virtual user). He is chrooted to the home directory

/home/mug/

I tried the following things:

1. set umask setting in /etc/proftpd/proftpd.conf

Umask 000  000

This should result in 777 for directories and 666 for files since directory umask is applied to 777 and file umask is applied to 666.

After that I of course restarted the proftpd to be sure that the config is reloaded.

2. set umask for the user in /home/mug/.bashrc

I added the following to the .bashrc for the user:

umask 0000

After that I reloaded the .bashrc:

source /home/mug/.bashrc

I also checked the umask setting for the user by changing to the user and using this command:

su mug
umask

As result I got a umask of 0000 prompted. So this worked.

But still all my uploaded files are having 644 permissions set 🙁

What am I doing wrong?

Best Answer

Proftp starts with an base mode of 0666, and since umask can only take rights away, you can never reach 0777.