How to install ftp in kali linux and enable it #ftpserver #ftpkalilinux #ftp #server #kalilinux

 

To enable FTP on Kali Linux, follow these steps:


1. Install an FTP Server

Kali Linux doesn’t come with an FTP server installed by default. A popular choice is vsftpd (Very Secure FTP Daemon).

Run the following command to install it:

sudo apt update
sudo apt install vsftpd

2. Edit the vsftpd Configuration File

The configuration file for vsftpd is located at /etc/vsftpd.conf. Open it in a text editor:

sudo nano /etc/vsftpd.conf

Make the following changes or verify the options:

  • Uncomment the line to allow local users to log in:
    local_enable=YES
    
  • Uncomment the line to allow file uploads:
    write_enable=YES
    
  • (Optional) If you want anonymous access (not recommended for security reasons), uncomment and set:
    anonymous_enable=YES
    
  • For a more secure setup, enable chroot for local users:
    chroot_local_user=YES
    
  • Save the changes and exit (Ctrl+O, Enter, Ctrl+X).

3. Restart vsftpd Service

After editing the configuration, restart the vsftpd service:

sudo systemctl restart vsftpd

Enable the service to start on boot:

sudo systemctl enable vsftpd

4. Adjust Firewall Rules

If you’re using a firewall (e.g., ufw), allow FTP traffic:

sudo ufw allow ftp

For passive FTP mode, you may need to open additional ports. Configure them in /etc/vsftpd.conf:

pasv_enable=YES
pasv_min_port=30000
pasv_max_port=31000

And open the corresponding ports in the firewall:

sudo ufw allow 30000:31000/tcp

5. Test the FTP Server

You can test your FTP server using the ftp command or an FTP client like FileZilla. Connect using the server's IP address, username, and password.

Example command:

ftp localhost

Notes:

  • Use a strong password for users to secure your FTP server.
  • For added security, consider using SFTP (via SSH) instead of FTP, as FTP transmits data in plain text. SFTP is enabled by default with an SSH server.

Let me know if you face any issues!

Comments