User Tools

Site Tools


ftp-install

This is an old revision of the document!


How to install an FTP Server

Install vsftpd

'sudo apt update && sudo apt install vsftpd

Once installed check status

vsftpd.service - vsftpd FTP server
     Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-04-27 19:35:30 IST; 13s ago
   Main PID: 54532 (vsftpd)
      Tasks: 1 (limit: 1137)
     Memory: 652.0K
     CGroup: /system.slice/vsftpd.service
             └─54532 /usr/sbin/vsftpd /etc/vsftpd.conf
 
Apr 27 19:35:30 ubuntu systemd[1]: Starting vsftpd FTP server...
Apr 27 19:35:30 ubuntu systemd[1]: Started vsftpd FTP server.'

Congigue Firewall

sudo ufw allow 20/tcp
sudo ufw allow 40000:50000/tcp
sudo ufw allow 40000:50000/tcp
sudo ufw allow 990/tcp

Add FTP user

sudo adduser ftpuser

Add the user to the webserver root directory

sudo usermod -d /var/www ftpuser

Allow ftp user to write and alter documents in the web directory

sudo chown ftpuser:ftpuser /var/www/html

Configure vsftpd

Rename config file

''sudo mv /etc/vsftpd.conf /etc/vsftpd.conf.bak''

Create a new config file

''sudo nano /etc/vsftpd.conf

Paste in the following

''listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
force_dot_files=YES
pasv_min_port=40000
pasv_max_port=50000

@@_SP_@@

Save the file

Restart vsftpd

ftp-install.1603728125.txt.gz · Last modified: 2023/05/17 22:52 (external edit)