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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. What are SELinux Modes and how to set them
  2. CentOS / RHEL 7 : How to boot into Rescue Mode or Emergency Mode
  3. CentOS / RHEL : How to change the UUID of the filesystem
  4. The Squid Service in Failed State with Error: “Failed to make swap directory /var/spool/squid/00: (13) Permission denied”
  5. BTRFS: too many missing devices, writeable mount is not allowed
  6. How to Configure Proxy in CentOS/RHEL/Fedora
  7. Yum Command Fails with “Another app is currently holding the yum lock” in CentOS/ RHEL 7
  8. CentOS / RHEL : Move a Physical Volume from an existing Volume Group to another Volume Group
  9. Understanding the dm-multipath Configuration file /etc/multipath.conf
  10. How to schedule Jobs with Cron in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • What are different Oracle Database Vault Roles
  • Unable to export realm protected table using data pump
  • Beginners Guide to Oracle Database Vault
  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary