Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
What user is ProFTPD running as? Are all users having the same issue, or just that one? –  Satanicpuppy Oct 14 '09 at 17:43
    
Proftpd is running as user proftpd and group is nogroup. And this also happens when I log in with other users. –  Jens Oct 14 '09 at 17:51
add comment

3 Answers

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

share|improve this answer
add comment

Check the umask for user Proftpd and group nogroup. Since you're trying to set permissions higher than the system default, they may be restricted by their OWN umask values.

A way to check it might be to change the umask in proftpd.conf to 777; if new files show up as 000, then you know that configuration line is working.

share|improve this answer
    
I set the umask in proftpd.conf to 777 as you said with the same result. To change the umask for the user proftpd I changed /etc/profile (since proftpd has no home dir) and reloaded the file again via "source /etc/profile". But again: permissions are set to 644. –  Jens Oct 14 '09 at 18:11
    
Okay, so it's ignoring the umask in proftpd. Hmmmm. What version of proftpd are you using? There were a bunch of umask problems with proftpd once... –  Satanicpuppy Oct 14 '09 at 18:28
    
I am using proftpdd 1.3.1. But I also tried vsftpd with the same result. So my guess is that this is related to Debian. –  Jens Oct 14 '09 at 18:30
add comment

It's possible that proftpd considers a ulimit of "000" bad and won't let you do that, it should log if that's the case.

share|improve this answer
add comment

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.