vsftpd Access – Allow Local Users to Access /var/www Folder

ftpUbuntuvsftpd

I have successfully installed the vsftpd. and it is live, but I get following error:

Response:   500 OOPS: cannot change directory:/home/sovit

What I want to do is direct all local users of the system to the /var/www folder instead of their home root.

Below is the vsftpd conf file:

http://pastie.org/2284176

Any help would be appreciated.
Thank you.

Best Answer

  • Define an unprivileged user with nopriv_user, assuming is ftpsecure
  • Change GID of all the ftp users to the same with ftpsecure
  • Change the umask of webserver user and vsftpd to 002
  • chmod -R g+w /var/www

PS: As another way: you can change the $HOME folder of ftp user to the /var/www instead of setting local_root in vsftpd.conf.