Skip to content

Instantly share code, notes, and snippets.

@otkrsk
Last active July 14, 2016 05:17
Show Gist options
  • Save otkrsk/9b25a6b11ba019c915f5fed1521a36f8 to your computer and use it in GitHub Desktop.
Save otkrsk/9b25a6b11ba019c915f5fed1521a36f8 to your computer and use it in GitHub Desktop.
Gist to set up and configure vsftpd on Ubuntu

Run:

sudo apt-get install vsftpd

Edit /etc/vsftpd.conf

Disable anonymous login

anonymous_enable = NO

Allow local users to login

local_enable = YES

Allow local users to write to a directory

write_enable = YES

'Jail' the local user to their own home directory

chroot_local_user = YES

Restart vsftpd:

service vsftpd restart

Add an FTP user:

adduser ftp_example_user

Create a directory for this user in their home directory. Change the home directory ownership to root, create a directory that you want to upload to, e.g., uploads and change the ownership of that folder to our user, in this case, ftp_example_user.

sudo chown root:root /home/ftp_example_user
sudo mkdir /home/ftp_example_user/uploads
sudo chown ftp_example_user:ftp_example_user /home/ftp_example_user/uploads

We finish the setup by restarting vsftpd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment