Signup/Sign In
JUNE 26, 2023

HOW TO CHANGE FTP PORT?

    FTP or Protocol Transfer Protocol is one of the oldest Internet protocols used today as an online file transfer computer. The FTP protocol uses standard port 21 / TCP as port commands. However, there are several installations of FTP protocol on server-side on Linux, in this guide we will cover how to change the port number in the Proftpd service entry.

    Change FTP Port to Linux

    To change the default Proftpd port on Linux, first open the Proftpd main configuration file for editing in your favorite script by giving the command below. Files are opened in different ways, specifically for the Linux server you are installing, as follows.

    # nano /etc/proftpd.conf [On CentOS / RHEL]
    # nano /etc/proftpd/proftpd.conf [Debian / Ubuntu]

    In the proftpd.conf file, search for and say a word that starts at Port 21. You just need to add '#' (hashtag) in front of the line to speak.

    Then, under this symbol, enter the new port number and the new port number. Any non-standard TCP port can be added between 1024 and 65535, and the location and new port have not been entered into your system by other used applications.

    In this example, we will link the FTP function to port 2121 / TCP

    #Port 21

    FTP function to port 2121/TCP

    #Port212

    Change FTP Port to Debian & Ubuntu

    On RHEL-based servers, the Port icon is not in the Proftpd configuration file. To change the port, add a new port symbol to the top of the configuration file, as described below.

    Port 2121

    Change FTP Port to CentOS & RHEL

    After changing the port, restart the Proftpd daemon to apply the change and command the netstat to confirm that the FTP service is listening to the new port 2121 / TCP.

    # systemctl Restart proftpd
    
    # netstat -tlpn | grep ftp
    

    Or

    # ss -tlpn | grip ftp

    Confirm FTP Port

    Under a server based on CentOS or RHEL Linux, install the policycoreutils package and add it under the SELinux command to create the FTP daemon at port 2121.

    # yum install policycoreutils
    
    # semanage port -a -t http_port_t -p tcp 2121
    
    # flood port -m -t http_port_t -p tcp 2121
    
    # systemctl Restart proftpd

    Finally, update the Linux distributed firewall command to allow inbound traffic to the new FTP port. Also, check the FTP server passive port and make sure you are updating the firewall command to display port acceptance.

    For windows

    Windows 7 and Windows 8 / 8.1

    To increase FTP traffic in Windows 7 and 8:

    • In Windows Control Panel, open the Windows Firewall.
    • Windows Control Panel: Windows Firewall
    • Windows Firewall – Advanced settings
    • Click Advanced Settings. Here, you will create a new inbound command to allow FTP traffic from the firewall.
    • In the Windows Firewall and Advanced Security dialog, click Inbound Rules: New Rules.
    • Create a new firewall rule.
    • On the next screen, select the command type 'Port.'
    • Specify the port number
    • In the New Inbound Rule Wizard dialog, release the selected TCP, and enter the port numbers 20 and 21 (“20, 21”). FTP uses the port numbers 20 and 21 for command management and data transfer.
    • Select the Allow option to allow the link to accept incoming traffic to these ports.
    • Allowing traffic to arrive.
    • Depending upon the network that you are connected to, select the type of connection where the rule should apply. Can choose three (Domain, Private, and Public) if you do not know which one to choose.
    • Call it a firewall
    • Give a name for the command you created, for example, “FTP.” This name will appear under the Windows 8 or 8.1 Internet Admissions Policy.

    Mac OS X

    In OS X Maverick, the Preferences setting to make FTP services no longer available. As with the other versions of OS X, however, the FTP function can be enabled using the launchtl function.

    In addition to enabling FTP, there must be changes to the OS X firewall settings.

    To enable FTP on OS X Maverick:

    • OS X Utilities menu
    • From the desktop menu, select Go to: Hardware.
    • In the Utilities dialog, open terminal.
    • In the window together, execute the command:
    • sudo launchs launctll load /w /System/Library/LaunchDaemons/ftp.plist

    To disable FTP, follow the following instructions:

    sudo launchs launctll download Sw /System/Library/LaunchDaemons/ftp.plist
    • Changing firewall settings
    • To change the firewall settings on OS X:
    • From the Apple menu, select Preferences System.
    • In the Preferences system, open Security and Privacy.
    • In the Security & Privacy dialog, click the lock icon on the bottom left. OS X prompts you to configure a password.
    • Click Turn on Firewall.
    • Press + to add an application.
    • Browse the application and select it.
    • Click Add to add applications to the firewall.
    • Set the application to allow incoming links. Note the default signal and the automatic connection connections automatically.
    • Click OK and leave the firewall folder. The firewall will automatically relock as soon as it exits.

    IF YOU LIKE IT, THEN SHARE IT
    Advertisement

    RELATED POSTS