Ubuntu – Basic Ubuntu FTP Server


I would like to setup a basic FTP server on my Ubuntu Server install. I have been playing with VSFTPD, but am having issues getting the server to allow me to create directories and copy files. I have set the system to allow local users, but it appears that doesn't mean I get access to create directories. This may be an instance where I need to be better grounded in Ubuntu server setup in order to configure this FTP server adequately. The end goal is to be able to move files from my local dev folder into my www folder for deployment. Directories need to be able to move as well. Any help would be greatly appreciated.

Best Answer

I'm going to recommend PureFTPD because it's been the simplest and easiest to use in my opinion. You'll need to install it first: sudo apt-get install pure-ftpd once it's installed it'll start itself up. By default it uses PAM Authentications - meaning it uses the accounts which already exist on the system for it's auth. All you'll need to do is create a user account with the home directory being your www path and set the password for that account. You should then be able to connect with that user/pass combination to upload/download files.

Something like this:

sudo adduser ftpman --home /var/www/ --ingroup www-data

Which will create the ftpman user and put him in the www-data group which Apache uses and will walk you through the rest of the setup script. Once that's defined make sure to chmod the WWW folder if you get errors about it already existing to the user/group combination you created.

Lastly if you want to lock down SSH access for that account run: sudo chsh -s /bin/false ftpman which will change that users shell to false. (Replace ftpman with your ftp user)