mysql remote access rectriction

rahulk98

Registered
Sep 29, 2006
2
0
151
I want to restict Mysql remote access to my server. i want to allow only specific IPs which i want to.
Iam using WHM. how can i do this through WHM (cpanel) and through shell. Please let me know how i can do this.
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
The simplest and easiest way to do this is to run MySQL external access on a separate non-standard port number. That way people can get access from outside easily if they know the port number.

Another alternative is to use something like csf or apf that allow you to whitelist connections to certain ports from certain IPs.
 

rahulk98

Registered
Sep 29, 2006
2
0
151
Iam using APF. How can i restrict the remote access fro APF and allow only some externa IPs to access mysql database.
 

Fernis

Well-Known Member
Oct 28, 2006
192
1
168
You can perform this level of filtering with the allow_hosts.rules file using the advanced rules format. Try adding the following, with modified IP to the /etc/apf/allow_hosts.rules file then restart apf (/etc/init.d/apf restart or apf -r):

in:d=3306:s=10.2.3.11