LinuxQuestions.org
Support LQ: Use code LQ3H and save $3 on Web Hosting

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have access to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Go Back   LinuxQuestions.org > Forums > Linux > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Reply
 
Thread Tools
Old 04-17-2003, 05:35 PM   #1
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,732
mysql port 3306


[Log in to get rid of this advertisement]
Well, this isn't a security issue per se, but I am curious about a few things. I only run a webserver, so my iptables firewall drops everything not destined for port 80, however, when I run nmap it shows 3306 mysql as open.

I do use mysql, but it is on the same computer so I don't need the port open right?

Why does port 3306 ignore my firewall rules? Anyone know what's up?
bulliver is offline     Reply With Quote
Old 04-17-2003, 05:44 PM   #2
Hangdog42
Guru
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 5,513
You might want to post your iptables script to get a better answer. However, I'll hazard the guess that your script isn't blocking internal requests. In other words, if you used nmap to scan from a different computer, you might not see port 3306 open.

Of course without seeing your iptables rules, this is nothing more than a WAG.
Hangdog42 is offline     Reply With Quote
Old 04-17-2003, 06:27 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,732
Hey, maybe you're right.

Here's the relevant sections:
Code:
# set a sane policy:    everything not accepted > /dev/null
iptables -P INPUT    DROP
iptables -P FORWARD  DROP
iptables -P OUTPUT   DROP

# allow local-only connections
iptables -A INPUT  -i lo -j ACCEPT

# free output on any interface to any ip for any service (equal to -P ACCEPT)
iptables -A OUTPUT -j ACCEPT

# permit answers on already established connections
# and permit new connections related to established ones (eg active-ftp)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# accepts http requests at port 80 
iptables -A INPUT -p tcp --dport 80  -j ACCEPT
Perhaps you could scan me to see...my domain is in my sig
bulliver is offline     Reply With Quote
Old 04-17-2003, 07:51 PM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 6,434
If you never connect to mysql over the network you may want to add
Code:
skip-networking
to your [mysqld] section in /etc/my.cnf.

--jeremy
jeremy is offline     Reply With Quote
Old 04-17-2003, 08:00 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,732
Cool, thanks Jeremy. Worked perfectly...

Last edited by bulliver : 04-17-2003 at 08:14 PM.
bulliver is offline     Reply With Quote

Reply

Submit thread to Digg | Submit thread to del.icio.us | Submit to LQ Bookmarks

« Back to Top »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL not listening on port 3306 mr_sarge Linux - Newbie 11 04-21-2008 11:56 AM
mysqld running and reading for connections on port 3306, no port 3306 found from scan darkenigmaa Linux - Networking 7 09-21-2005 10:10 AM
OpenBSD MySQL port Erik Thorsson *BSD 3 10-20-2004 06:10 PM
How do I allow mysql connections over network (netstat -an | grep 3306 produces nil)? jdruin Linux - Software 2 07-05-2004 02:48 AM
mysql 3306 security sopiaz57 Linux - Security 8 03-07-2004 04:32 PM



Add LQ To Your Yahoo Add LQ To Your Google Add LQ To Your MSN Add LQ To Your Blog
All times are GMT -5. The time now is 02:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Open Source Consulting | Domain Registration