Restrict phpMyAdmin access to only internal private IP address
I managed to configure my phpmyadmin to only allow access from within my network only (the private IP address range) e.g. 192.168.1.XXX.
This is important to ensure the security of your database, I just do not want people to guest all the password by entering into the phpmyadmin setting.
To do so, copy the following code to config.inc.php in the phpmyadmin folder:
//block root from logging in except from the private networks
$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
'deny root from all',
'allow root from localhost',
'allow root from 192.168.1.0/24',
);
The “0/24″ denotes wildcat (equivalent to * in Windows)
After that chmod 705 the file
Then restart your lightpd server using the following command:
sh /ffp/start/lighttpd.sh restart
now your phpmyadmin can only be accessed from your LAN network only.
6 Comments »
Leave a comment
-
Archives
- October 2009 (3)
- September 2009 (2)
- June 2009 (1)
- May 2009 (3)
- April 2009 (2)
- March 2009 (3)
- February 2009 (1)
- January 2009 (3)
- December 2008 (9)
- October 2008 (5)
- September 2008 (1)
- August 2008 (5)
-
Categories
-
RSS
Entries RSS
Comments RSS







Thank you for the script, was very helpful….:)
Nice. It works, though it still allows people to try and log on. Would be better if PHPMyAdmin applied this to the logon page too.
Thanks for the tip. Very useful!!!
Cheers
[...] fonte: Restrict phpMyAdmin access to only internal private IP address [...]
Pingback by PHPMyAdmin somente para a rede interna « Linuxing | 21/06/2009
FUCK ISLAM and eat HALAL ASS of your prophet
Thanks for the script. It did not work with my iMac, it still allow root access from other machines, although I commented the last line.
I did not like the last comment. Even though I don’t agree with conservative Muslims, I don’t accept general blind blame