About Linux FAQ

Browse More FAQs:

Change vsftpd ftp server port 21

Posted by Vivek Gite [Last updated: December 12, 2006]

Q. Because of security issues I would like to change vsftpd port 21. How do I configure vsftpd to use other ports instead of default TCP port 21.

A. vsftpd, which stands for Very Secure FTP Daemon, is an FTP server under Ubuntu, Fedora Core, Red Hat Enterprise Linux and a number of other distributions.

Changing default port is good idea.

All you need to do is edit the configuration file for vsftpd server. The default configuration file is /etc/vsftp/vsftpd.conf or /etc/vsftpd.conf.

First login as root user

Open vsftpd.conf file
# vi vsftpd.conf

Find line that read as follows
listen_port=21

Replace port 21 with new port such as 201
listen_port=201

Save and close the file. 201 is port number you can set it to whatever port you want. Please make sure no other service use 201 port.

Now restart vsftpd
# /etc/init.d/vsftpd restart

Client need to use port 21 while connecting to ftp server:
$ ftp ftp.myserver.com 201

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Discussion on This FAQ

  1. Dhiraj Says:

    After changing the default port number not able to use ftp service from outside network. From Lan it is working fine

  2. nixcraft Says:

    Dhiraj

    Make sure new port is open at firewall.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.