• 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. dirb Command Examples in Linux
  2. RCRON – Setup High Availability of cron Jobs
  3. Understanding Linux multipath (dm-multipath)
  4. CentOS / RHEL 7 : Unable To Start The Samba Service
  5. How to Partition DM-Multipath Pseudo Devices in CentOS/RHEL
  6. lastcomm Command Examples in Linux
  7. dig: command not found
  8. zip Command Examples in Linux
  9. How to avoid ssh from prompting key passphrase for passwordless logins
  10. sysctl: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright