Skip to content

Instantly share code, notes, and snippets.

@ominfowave
Last active May 16, 2019 06:18
Show Gist options
  • Select an option

  • Save ominfowave/3d8d9aaa3dca1da5c41048c2417401bc to your computer and use it in GitHub Desktop.

Select an option

Save ominfowave/3d8d9aaa3dca1da5c41048c2417401bc to your computer and use it in GitHub Desktop.
VSFTPD simple steps

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 [keep it disabled by hash]

####chroot_local_user = YES####

Restart vsftpd:

service vsftpd restart

Add an FTP user:

adduser sammy
OR
adduser -d /var/www/html/ sammy

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, sammy.

sudo chown root:root /home/sammy
sudo chown sammy:sammy /var/www/html
usermod -d /var/www/html/ sammy

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