File Transfer Protocol is a standard network protocol used for the transfer of computer files from a server to a client/machine on a computer network.
Requirements :
Server Connected to the internet
Root access to the Server
Before to start updates your system with the current Command
#dnf update & dnf upgrade
Step 1:
Firstly we have to check the package vsftpd is installed in our machine, if not so then follow the steps to install it:
# dnf install -y vsftpd
Step 2:
To enable vsftpd in multi-user levels. en start
# systemctl enable vsftpd
#systemctl start vsftpd
Step 4:
Create FTP firewall rule to allow traffic on port 21
sudo firewall-cmd --zone=public --permanent --add-port=21/tcp
sudo firewall-cmd --zone=public --permanent --add-service=ftp
sudo firewall-cmd –-reload
Step 5:
Now its time to tune your configuration
Now edit the /etc/vsftpd/vsftpd.conf file.
Disable anonymous , enable local users . allow local user to write data
Allow users only to use their own directory (jail account / jail chroot) and allow them to write (optional)
chroot_local_user=YES
allow_writeable_chroot=YES
User list is a way to approve created FTP users before you can enable it with this way
userlist_enable=YES
userlist_file=/etc/vsftpd/user_list
userlist_deny=NO
Save the conf file , and reload FTP settings
systemctl restart vsftpd
Create FTP users:
sudo useradd ftpunixcop
sudo passwd ftpunixcop
Add user to the user_list file
sudo bash -c 'echo ftpunixcop >> /etc/vsftpd/user_list'
Tests .
Try to connect with user that doesn’t exit in user_list
Try to connect with user ftpunixcop included in the users list file
It works / please enjoy !!