Remote access to MySQL with a dynamic IP blocked by csf
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
-
Hello :) The following location should be helpful if you are looking for a file to utilize for your custom bash script: /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: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.0
Please sign in to leave a comment.
Comments
1 comment