![]() |
MySQL: How to Block specific hosts
Hi all,
I was wondering if there was any way to block specific IPs from connecting to MySQL? For example, I want all machines on an internal network to be allowed to connect except for one. I currently use 192.168.1.% in mysql.user table so that all hosts are allowed. Is there a way to leave that and disallow just one host? Or must I remove that line and enter every single IP on my network one by one (except ofcourse the one I don't want to connect) ?? Thanks |
Ugh - I don't trust mysqld security.
You could use TCP wrappers to restrict access, but even better - use iptables/ipchains to block at the packet level. |
mysql is not a firewall, you do not issue block statements...
If you want you can fill me in on what your database does, i think you just have no understanding on administration of mysql, you only have to add the ip's to each database, with its own set of special commands it can run, and not mysql in general anyhow, if you are not doing that, then you are doing it all wrong. |
Quote:
Also, make sure you're on a switched network, or all this filtering is moot. |
Quote:
Instead of granting each host I want to have access, it was a LOT easier to just keep my wildcard host (192.168.1.%) and then add a row containing the IP I wanted to block, with the same username as the record above, a different password and no privileges. Thus, anyone trying to connect from that IP with the same username all other servers use, will: 1) Have to find out the password somehow 2) If they do get the password, they will have no privileges on any database tables. |
Quote:
I just wanted to block one of demo servers that our team uses from accessing the real DB, incase they are testing something and have the wrong host specified :) |
unfortunately i don't think you can, if you granted access to a block of ips i think that is it with mysql. Only thing could think of is to run a sql script that would grant access to each ip, excluding the demo server or server ips that you don't want
|
Quote:
|
please note that using .% is not a secure method, since i know now you use 192.blah.% let me show you why this is worthless..
I just added 192.168.1.mysqlhacker.com to my dns I can now connect to your mysql :) with my domain and host This is mysql security 101, you really need to read the manuals |
Quote:
|
Quote:
|
heh, probably not too hard for me, but i have no use for another mans porn :) nor a desire to reak havok... dunno what rush hackers get outta that stuff.. never interested me a bit
|
nice attack from 207.173.177.210
OrgName: Electric Lightwave Inc OrgID: ELIX Address: 4400 NE 77th Ave City: Vancouver StateProv: WA PostalCode: 98662 Country: US are you done giggling now, because i don't fuck around and trust me my skills are far superior than yours |
Quote:
|
Quote:
|
LOL, he didn't ask about security or anything, just how to do or if you can do something in mysql, but every felt the need to flex. LOL I love it.
|
Quote:
|
Quote:
|
Quote:
Not everything I ask is because I have to do it...sometimes its just to satisfy my curiosity or enhance my knowledge :upsidedow |
use ipfw to blockout ips that you dont want connecting.
|
All times are GMT -7. The time now is 01:10 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123