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.

Remote access to MySQL with a dynamic IP blocked by csf

Discussion in 'Database Discussions' started by Neutrall, Sep 11, 2014.

  1. Neutrall

    Neutrall Member
    PartnerNOC

    Joined:
    Jul 22, 2014
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hi to All :) !

    I’m trying to resolve a problem…:confused:

    On the server where the problem is occurring, we have ConfigServer Firewall installed.
    One of our cPanel users need to connect to his database from his local computer with a Dynamic IP. Ideally, the client only needs to add his IP in his cPanel to access remotely his database, but csf is blocking the Port 3306 for all user.

    Every time is IP change; we have to manually update his IP in the csf white list.

    Is there a way make the process automated?

    I first though of a BASH or PERL script to check if a user add/change an IP from his cPanel and update the csf white list (But I don’t know in which file cPanel write the allowed remote MySQL IP)

    Looking forward for your inputs.

    Note: My client doesn’t want to use a DynDNS service
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The following location should be helpful if you are looking for a file to utilize for your custom bash script:

    Code:
    /var/cpanel/databases/grants_$username.yaml
    The following entry will appear in this file, assuming the user authorizes 1.1.1.1 as an access host:

    Code:
    GRANT USAGE ON *.* TO '$username'@'1.1.1.1' IDENTIFIED BY PASSWORD
    You could develop a script that fetches 1.1.1.1 from this entry.

    Thank you.
     
Loading...

Share This Page