Disabling FTP

Created by Sanjay Kumar, Modified on Fri, 6 Sep at 2:16 AM by Sanjay Kumar

To disable FTP while keeping SFTP enabled with the given configuration, you can make the following changes:

  1. Open the vsftpd.conf file using a text editor:        sudo nano /etc/vsftpd/vsftpd.conf
  2. Add the following line at the end of the file to configure vsftpd to listen on the SFTP port (port 22) instead:  listen_port=22
  3. Save the changes and exit the text editor.
  4. Restart the vsftpd service to apply the new configuration:           sudo systemctl restart vsftpd 
With these changes, vsftpd will no longer listen on the FTP port (21), effectively disabling FTP. However, it will still be listening on the SFTP port (22), allowing SFTP connections to continue functioning.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article