To install an FTP server on Kali Linux, you can use the vsftpd (Very Secure FTP Daemon) package, which is a widely used FTP server software known for its security features. Here's a step-by-step guide to install and configure vsftpd on Kali Linux:
- Update the package list:
sudo apt update
- Install the
vsftpd package:
sudo apt install vsftpd
- Backup the original configuration file:
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig
- Open the configuration file in a text editor (e.g.,
nano or vim):
sudo nano /etc/vsftpd.conf
- Make the following changes to the configuration file:
- Uncomment the following lines to enable anonymous FTP access (optional):
anonymous_enable=YES
- Uncomment the following lines to allow local users to log in:
local_enable=YES
- Uncomment the following lines to allow users to upload files:
write_enable=YES
- Uncomment the following lines to allow users to download files:
chroot_local_user=YES
- Uncomment the following lines to enable SSL/TLS encryption:
ssl_enable=YES
- Uncomment the following lines to specify the SSL certificate and key files:
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
- Uncomment the following lines to enable TLS encryption:
tls_sslv2_enable=YES
tls_sslv2_port=0
tls_sslv3_enable=YES
tls_sslv3_port=0
- Uncomment the following lines to enable TLS encryption for FTPS (FTP over SSL):
allow_anon_ssl=YES
force_local_data_ssl=YES
force_local_logins_ssl=YES
- Uncomment the following lines to enable FTP over SSL/TLS:
ssl_enable=YES
- Uncomment the following lines to specify the SSL certificate and key files (if different from the previous lines):
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
- Uncomment the following lines to enable FTP over SSL/TLS:
force_local_data_ssl=YES
force_local_logins_ssl=YES
-
Save the changes and exit the text editor.
-
Restart the vsftpd service:
sudo systemctl restart vsftpd
- Create a user and grant them FTP access (optional):
sudo adduser ftpuser
sudo usermod -aG ftpgroup ftpuser
- Create a directory for the user's FTP files and set the appropriate permissions:
sudo mkdir /home/ftpuser/ftp
sudo chown nobody:nogroup /home/ftpuser/ftp
sudo chmod a-w /home/ftpuser/ftp
sudo mkdir /home/ftpuser/ftp/files
sudo chown ftpuser:ftpgroup /home/ftpuser/ftp/files
- Test the FTP server by connecting to it using an FTP client (e.g., FileZilla, WinSCP, or the
ftp command-line tool).
Remember to replace ftpuser and ftpgroup with the desired username and group name. Also, ensure that the SSL certificate and key files are properly configured and valid.