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

The Geek Diary

HowTos | Basics | Concepts

  • Solaris 11
  • Solaris
    • SVM
    • ZFS
    • Zones
    • LDOMs
    • Hardware
  • Linux
    • CentOS/RHEL 7
    • RHCSA notes
    • SuSE Linux Enterprise
    • Linux Services
  • VxVM
  • VCS
  • Interview Questions
  • oracle
    • ASM
    • mysql
    • RAC
    • oracle 12c
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting

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 identify the HBA cards/ports and WWN in Linux
  2. How to disable firewalld and and switch to iptables in CentOS / RHEL 7
  3. CentOS / RHEL : How to find kernel parameters used while booting
  4. How to Configure Interface bonding (NIC Teaming) on Oracle Linux 6
  5. How to use tar command under Linux
  6. What causes iptables to load every time after a reboot even when it’s completely turned off
  7. Linux OS Service ‘anacron’
  8. How to create virtual block device (loop device/filesystem) in Linux
  9. How to Tune Btrfs Filesystem for Better Performance
  10. CentOS / RHEL : How to backup/restore configuration using authconfig

You May Also Like

Primary Sidebar

Recent Posts

  • How to Change the System locale in CentOS / RHEL 5,6
  • Run Docker as a non-root user
  • How to Configure Btrfs as the Storage Engine in Docker
  • How to check failed or bad login attempts in Linux
  • How to configure chrony statistics in CentOS / RHEL 7

Footer

Cheat Sheets

  • LDOMs (OVM for SPARC) Command line reference
  • Solaris Volume Manager (SVM) command line reference
  • Solaris ZFS command line reference
  • RHEL 7 – RHCSA Notes (Cheat Sheets)
  • CentOS / RHEL 7 : firewalld Cheat Sheet
  • systemd command line reference (cheat sheet)

Solaris interview questions

  • The ultimate Solaris Volume Manager (SVM) interview questions
  • The ultimate Solaris zones (containers) interview questions
  • The ultimate Solaris networking interview questions
  • The ultimate ZFS interview questions
  • Archives
  • Contact Us
  • Copyright

© 2018 · The Geek Diary