Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Basic MySql Security
PostPosted: Sat Aug 20, 2011 8:19 pm 
Offline
Senior Newbie

Joined: Wed Aug 10, 2011 1:27 am
Posts: 16
I am migrating my wordpress blogs to Linode from shared hosting.

I managed to use the command line to copy over my databases, and I have implemented the general security tips
- disallow password authentication
- fail2ban
- disallow root logins in my main apache config.
- changed the default SSH port (although I see that some people don't think this is necessary).
- ufw firewall only allowing my SSH port, 80, and 443.

But - what should I be doing in terms of MySql security specifically?

When I first set up my Linode using the LAMP stackscript, I used root as the user and I'm wondering if I need to change this, and how to do this safely.

I want to be able to use the automatic database backup plugin in Wordpress, and I have Linode backups turned on, but otherwise no one needs any access to my Linode other than me from my local machine at my home static IP.

I'm a supernewbie and I'd really appreciate some advice.

Thanks!


Top
   
 Post subject:
PostPosted: Sun Aug 21, 2011 9:30 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Probably the main thing is to make sure MySQL is not listening for outside connections. You can check like so:
Code:
# netstat -lvnut
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 127.0.0.1:3306              0.0.0.0:*                   LISTEN      4821/mysqld
...

If you see 127.0.0.1:3306 (or the IPv6 equivalent, can't remember what it is right now) in the Local Address column, then MySQL is only listening on the loopback interface. If you see 0.0.0.0:3306 (or :::3306), it is accepting connections from the outside world and you should change bind-address.

If you don't see it in the netstat output, then MySQL is probably using a UNIX socket (you can check with netstat -lvpn --protocol=unix) which is not open to the outside.


Top
   
 Post subject:
PostPosted: Mon Aug 22, 2011 1:27 pm 
Offline
Senior Newbie

Joined: Wed Aug 10, 2011 1:27 am
Posts: 16
Cool - thanks. I ran it and its not accepting outside connections so that's looking good.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group