I am trying to make changes to my website over ftp but when I save any files it changes the permissions and owner to my username. I can edit files in the same folder trough samba without changing the permissions. I really don't understand how the permissions for the /var/www folder work and I'm pulling my hair out trying to get it to work. I have recently made changes to the permissions of the /var/www directory (following this guide) so I could modify files in the www root. Right now I have the entire contents of /var/www set as -rwxrwxr-x 1 www-data www-data but when I change a file over ftp it becomes -rw------- 1 akbkuku akbkuku, akbkuku being my username. I am using vsftpd as the server, and I login with my normal user.

How do I make it leave to permissions alone?

At this point I'll even take a way yo reset all the permission back to stock and I'll just never modify files in the web root.

2 Answers 2


The settings depend on which FTP client you are using. Also to some extent the FTP server you are connecting to.

Usually, from the ftp command line,you can

  1. set your umask for the session, or
  2. change the permissions on files/directories that you own.

If you want to be sure that the website sees your files, make sure they are WORLD readable (and directories have RX bits set).

  • I think it was my client. I was using ftpuse to mount the server as a remote drive in windows. I now know that windows 7 does it natively. I tried using winscp so I could get to the web directory and when I had modified files it didn't change the permissions, thank you!
    – AkBKukU
    Commented Dec 7, 2012 at 1:12

It might be a vsftpd configuration issue. If you're getting -rw-------, maybe the option file_open_mode is set to 0600 or local_umask to 060. From man vsftpd.conf:


The permissions with which uploaded files are created. Umasks are applied on top of this value. You may wish to change to 0777 if you want uploaded files to be executable.

Default: 0666


The value that the umask for file creation is set to for local users.

Default: 077

If you want -rw-rw-r--, you could try changin one or both options in /etc/vsftpd.conf: file_open_mode=0660, local_umask=066.

Bear in mind that this change is server-wide. All uploaded files, even outside /var/www if it's not the only accesible directory, will get 660 permission, which might not be what you want.

  • I found the local_umask setting and made the change but it didn't fix it. I also saw the chown_uploads setting and tried that but it didn't work. I tried changing the client like mentioned in the post above and it no longer changed the permission. I don't know if the setting changed how the new client worked but it does now, thank you!
    – AkBKukU
    Commented Dec 7, 2012 at 1:15

You must log in to answer this question.

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