Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Remote access to MySQL with a dynamic IP blocked by csf

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

  1. Neutrall

    Neutrall Member
    PartnerNOC

    Joined:
    Jul 22, 2014
    Messages:
    24
    Likes Received:
    2
    Trophy Points:
    3
    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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,214
    Likes Received:
    1,936
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice