The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setting FTP port to something else

Discussion in 'General Discussion' started by mealto, Jul 15, 2008.

  1. mealto

    mealto Well-Known Member

    Joined:
    Oct 20, 2006
    Messages:
    175
    Likes Received:
    0
    Trophy Points:
    16
    How does one change the FTP port to something else to try and increase security? Where abouts is that setting? Also, which ports # can we change it to?
     
  2. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    If you are using pure-ftpd, you need to edit /etc/pure-ftpd.conf and change the port below to something other than 21.

    Code:
    # IP address/port to listen to (default=all IP and port 21).
    
    # Bind                      127.0.0.1,21
    
    If you are using protftpd, you need to edit/etc/proftpd.conf and change the port below to something other than 21:

    Code:
    Port                            21
    
    After making the change, you need to restart the FTP server to make the change live:

    Code:
    /scripts/restartsrv_ftpserver

    You can change to any open port on the system. To see what ports are currently in use use the following command:

    Code:
    netstat -an
     
  3. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    As a follow up. You should use FTP w/ TLS/SSL if you are worried about security. Make sure a SSL certificate is installed under Service Configuration >> Manage Service SSL Certificates in WebHost Manager. Installing this certificate will add the appropriate configuration file changes however, your users will have to choose FTP with SSL/TLS when connecting from their FTP client.
     
  4. djblamire

    djblamire Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    250
    Likes Received:
    0
    Trophy Points:
    16
    Is it possible to add an additional port for FTP ?

    Thanks
     
  5. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    With proftpd, you will need to add the following directive to any virtualhost in /etc/protftpd.conf that you wish to listen on the second port (it will always listen on the main port as well):

    Code:
    Port <portnumber>
    where <portnumber> is the secondary port number, i.e.

    Code:
    Port 478

    With pure-ftp, there is a patch that allows you to listen on multiple ports but since it's not part of the pure-ftp distribution, we consider it not supported. You can find more information at:

    http://sourceforge.net/tracker/index.php?func=detail&aid=1678743&group_id=18317&atid=318317
     
Loading...

Share This Page