Skip to content

Instantly share code, notes, and snippets.

@alifeee
Created December 19, 2023 15:50
Show Gist options
  • Save alifeee/f11e7295659576c236869079a3105025 to your computer and use it in GitHub Desktop.
Save alifeee/f11e7295659576c236869079a3105025 to your computer and use it in GitHub Desktop.
How to set up FTP on Ubtunu Linux

How to set up FTP on Ubuntu

Mainly following https://gist.github.com/CloudLinuxDeveloper/ec801e51c0a3917555c01d8b064e7f9a

sudo apt update && sudo apt install vsftpd
sudo service vsftpd status
sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 40000:50000/tcp
sudo ufw allow 990/tcp
sudo adduser weeknotes
sudo nano /etc/ssh/sshd_config
  > DenyUsers weeknotes
sudo service sshd restart
sudo mkdir /home/weeknotes/ftp
sudo chown nobody:nogroup /home/weeknotes/ftp
sudo chmod a-w /home/weeknotes/ftp
sudo mkdir /home/weeknotes/ftp/files
sudo chown weeknotes:weeknotes /home/weeknotes/ftp/files
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.original
sudo nano /etc/vsftpd.conf
> write_enable=YES
> chroot_local_user=YES
> chroot_local_user=YES
> force_dot_files=YES
> pasv_min_port=40000
> pasv_max_port=50000
> user_sub_token=$USER
> local_root=/home/$USER/ftp
sudo service vsftpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment