• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : How to configure vsftpd to use ports other than the default ports 20 and 21

by admin

Very Secure FTP Daemon (vsftpd) is the most secure and fastest FTP server. By default the vsftp server runs on the port 20 and 21. As a security recommendation, in some organizations system admins tend to change the port from the default ports 20 and 21 to some other ports. The post describes steps to change the default ports to the port numbers you want.

Changing default ports for vsftpd

1. Edit the configuration file /etc/vsftp/vsftpd.conf and add the below 2 lines to change the listening port and data originate port to something else:

# /etc/vsftp/vsftpd.conf
listen_port=A
ftp_data_port=B

Here,
A – listening port.
B – data originate port.

For example if you want the vsftpd service to run on ports 2020 and 2121 respectively, add below lines to the configuration file /etc/vsftp/vsftpd.conf.

# /etc/vsftp/vsftpd.conf
listen_port=2020
ftp_data_port=2121

The port number can be changed to a different number according to the requirements or environment. Make sure that the selected port will be used is currently not being used by any other services. Check the file /etc/services for a list of all assigned port numbers and have a look at the # netstat -plan output to get a list of currently used ports.

CentOS / RHEL : How to find if a network port is open or not?

2. Restart the service after you have modified the configuration file:

# service vsftpd restart

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Access VNC Server Through A Web Browser in Linux
  2. CentOS / RHEL : How to collect sosreport
  3. CentOS / RHEL : How to add a new Physical Volume to an existing Volume Group
  4. pvck Command Examples in Linux
  5. Audit Log And Messages File Not Rotating on CentOS/RHEL
  6. Choosing SSSD or Winbind & Samba for Active Directory Integration in CentOS/RHEL
  7. ifconfig Command Examples in Linux
  8. How to install rsyslog7 when rsyslog5 is already installed in CentOS/RHEL
  9. Linux Interview Questions – Linux Printing (CUPS)
  10. getsebool Command in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • What are /dev/zero and /dev/null files in Linux
  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright