Have you come up to a situation that you need FTP on your server? Well, its easy.
First thing we have to do is install the vsftpd on your server by using this command:
1 |
sudo apt-get -y install vsftpd |
After we install the ftp application, we have to configure it so it will work as expected. Lets open the vsftpd configuration file by using this command: (You can use any cli editor that you like)
1 |
sudo vi /etc/vsftpd.conf |
We will need to uncomment some lines, Find the following lines below and uncommen it:
1 2 3 4 5 6 7 |
write_enable=YES ascii_upload_enable=YES ascii_download_enable=YES chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list ls_recurse_enable=YES |
After you have uncommented those lines, we will need to add some important configuration at the end of the file:
1 2 3 4 5 6 |
# specify user root directory. If not specified, users home directory is equals to # FTP home directory local_root=public_html # turn off seccomp filter seccomp_sandbox=NO |
After adding those lines, we will need to add our user to the chroot_list.
1 |
sudo vi /etc/vsftpd.chroot_list |
Add the user 1 per line.
After adding, save it and we will restart our vsftpd service.
1 |
systemctl restart vsftpd |
Thats it!
Be First to Comment