Results 1 to 8 of 8

Thread: Host Access Control not working for FTP

  1. #1
    Member
    Join Date
    Nov 2011
    Posts
    49
    cPanel/WHM Access Level

    Root Administrator

    Default Host Access Control not working for FTP

    I am the only user who accesses the server either by FTP or SSH.
    My goal is to limit FTP access to the 2 IP's I ever use to access the server.

    I successfully limited SSH access using
    Main => Security Center => Host Access Control.

    But, for some reason it won't work for FTP?

    I removed my SSH rules and started from scratch.
    This is what I have tried:

    Daemon - ftp
    Access List - ALL
    Action - deny

    After restarting ftpd, I can still FTP in on any IP.
    Any ideas?

  2. #2
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    10,122
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Host Access Control not working for FTP

    Assuming you're using Pure-FTPD as it is the default on cPanel Powered Servers, this thread should be helpful:
    Blocking Ip's, htaccess works, Host Access Control Dont-- WTF?

  3. #3
    Member
    Join Date
    Nov 2011
    Posts
    49
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Host Access Control not working for FTP

    Thanks for the link and yes I am using Pure-FTPD.

    What you describe indicates a problem with the OpenSSH rpm from your Operating System vendor. You can attempt to re-install this rpm to resolve the issue, or open a support request at https://tickets.cpanel.net/submit/
    The above seems to be the solution, but I'm not sure I want to re-install the rpm.

    I have tried various methods to deny access in /etc/proftp.conf, without success:
    This method used to work in the past...

    Code:
    <Limit LOGIN>
    Order deny,allow
    Deny from 10.1.1.
    Allow from all
    </Limit>
    There must be an easier way...

  4. #4
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    10,122
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Host Access Control not working for FTP

    The above seems to be the solution, but I'm not sure I want to re-install the rpm.
    That thread is years old. Are you sure you'd have to?

    WHM > Service Configuration > FTP Server Selection

  5. #5
    Member
    Join Date
    Nov 2011
    Posts
    49
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Host Access Control not working for FTP

    Tried switching FTP server to it with ProFTPd, which as the post says, supports TCP Wrapper.
    Host Access Control has still has no effect on FTP connections.

    This really doesn't feel very secure...

  6. #6
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,475
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Host Access Control not working for FTP

    Please submit a ticket so that we can log into the server directly and find why this is not working as expected.
    For hands-on assistance, please reference our new support information page: Where should I go for support?
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation - Find cPanel hosting


    -- Jared Ryan, Technical Analyst, cPanel Technical Support

  7. #7
    Member
    Join Date
    Nov 2011
    Posts
    49
    cPanel/WHM Access Level

    Root Administrator

    Default Re: Host Access Control not working for FTP

    Here's some feedback after I submitted the ticket and those excellent CPanel guys got things working:

    The following needs to be added at the top of etc/proftpd.conf, after the ServerName section:

    Code:
    TCPAccessFiles /etc/hosts.allow /etc/hosts.deny
    TCPServiceName ftp
    # TCPAccessSyslogLevels debug warn
    AND for each Virtual Host.

    That's it. Now Host Access Control works as it should.

  8. #8
    cPanel Staff cPanelKeithS's Avatar
    Join Date
    Oct 2008
    Posts
    26

    Default Re: Host Access Control not working for FTP

    Quote Originally Posted by monkey64 View Post
    Here's some feedback after I submitted the ticket and those excellent CPanel guys got things working:

    The following needs to be added at the top of etc/proftpd.conf, after the ServerName section:

    Code:
    TCPAccessFiles /etc/hosts.allow /etc/hosts.deny
    TCPServiceName ftp
    # TCPAccessSyslogLevels debug warn
    AND for each Virtual Host.

    That's it. Now Host Access Control works as it should.
    Example VirtualHost for additional IPs
    Code:
    <VirtualHost 192.168.0.22>
      ServerName ftp.example.tld
      AuthUserFile /etc/proftpd/example
      MaxClients 3 "Sorry, this ftp server has reached its maximum user count (%m).  Please try again later"
      DirFakeGroup On ftpgroup
      DirFakeUser On ftpuser
      DefaultRoot ~
    
     TCPAccessFiles /etc/hosts.allow /etc/hosts.deny
     TCPServiceName ftp
    [truncated]
    Note: Proftpd should add the VirtualHost container for the additional IPs. The two additional directives for access control just need to be added inside of the VirtualHost
    cPResources:

    -- cPanelKeithS - Keith Stewart, Migration Specialist, Technical Analyst, cPanel Technical Support

Similar Threads

  1. Host access control not working
    By bmcgoo in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 03-14-2011, 07:35 AM
  2. Replies: 8
    Last Post: 06-24-2009, 06:20 PM
  3. cphulk and host access control stopped working after upgrade?
    By kjg in forum cPanel & WHM Discussions
    Replies: 8
    Last Post: 01-06-2009, 11:05 AM
  4. Host Access Control not working
    By bls24 in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 07-07-2008, 07:58 AM