Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My web root, /var/www, is owned by my personal user on the system, however I have also set up an FTP user with /var/www as its home directory.

If I put new files in /var/www via SSH logged in as either user (nano /var/www/something.html) everything is fine and new files recieve permissions 644, which is what I want. New directories put in via mkdir also work fine through each user and recieve permissions 755, also what I want.

The problem is that if I put new files in it via FTP, through either user, they recieve permissions 600, which is not what I want. Directories recieve permissions 700.

So how do I fix it so new files recieve the permissions I want? I am using vsftpd as an FTP server, if that helps anyone.

share|improve this question
up vote 1 down vote accepted

In the configuration file of /etc/vsftpd/vsftpd.conf

#anon_umask=066
anon_umask=022

chown_uploads=YES
chown_username=ftp

(ftp whatever user you want them to be)

Look at /etc/vsftpd/vsftpd.conf.example and read examples. It is pretty self explanatory.

share|improve this answer
    
Thanks! I'd been banging my head against permissions that seemed to be correct but still wouldn't work. I should have known it would have been in a config file. – Alfo Jul 22 '12 at 10:28
    
wouldn't hurt to also run a cron task with a script to verify the permissions say once an hour or so. As root. – tao Jul 23 '12 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .