I have been playing around with phpMyAdmin and I do think that it is a good tool, but I have read a lot on the internet about security holes. Would you recomend installing/using phpMyAdmin on a prduction webserver?

I figure that if I only allow access via localhost, and change it to a non standard port would help. But is that enough?

link|improve this question

feedback

5 Answers

up vote 2 down vote accepted

Would you recomend installing/using phpMyAdmin on a prduction webserver?

No, simply.

phpMyAdmin has an infamous security history as detailed on SecurityFocus.

You don't say what platform you're using, but assuming that you have remote access, I suggest:

  • When you need to perform basic tasks such as checking status or performing a dump.

    Learn how to use a handful of basic SQL and command line utilities from memory. You'll find that it could often be quicker than using phpMyAdmin to achieve the same result and they will serve as positively invaluable in an emergency situation.

  • When you need to perform tasks that are awkward or impossible without a GUI.

    Use a local client with tunneled access (such as SSH) to the MySQL server on localhost. This way you have all the power of a good client, secure transport and restricted access. Some good clients are Navicat, HeidiSQL and SQLyog. Some of those clients will even setup the tunnels automatically for you.

link|improve this answer
feedback

We install it on production machine AND expose it directly to the internet. We are a webhost though so have little choice in the matter.

The main thing is to stay up to date on new versions and follow the security mailing list. We can upgrade our phpMyAdmin installs in one click too with our upgrade scripts.

link|improve this answer
feedback

At least, change the default folder... My logs are just filled with hundreds of attempts to find a variant of the 'phpmyadmin' folder. I prefer to use something random, at least it will keep the bots away.

Also, restrict access to trusted IP's, or use a password-protected directory, and be sure not to have easily hacked users in Mysql (or to create very restricted and specialized users for phpmyadmin to use).

link|improve this answer
+1 for server-password-protected directory and source IP restrictions – Cheekysoft Sep 24 '09 at 11:55
feedback

Changing the port it runs on is "security-through-obscurity" at best, don't rely on any security gain from that; You may wave off a few script-kiddies, but you'll also be putting yourself up for managing a non-standard setup.

I would say - don't have it available on a production server if you can get away with it - i.e., if the business does not explicitly request it. One way you can at least improve security would be to have it "switched off" at all times, unless an administrator switches it on, and even then, either via policy or a inactive-timeout, it should switch back off.

This is analogous to saying "I do want a front door, but I'll keep it locked at all times, unless I need to use it, at which time I'll open it up temporarily".

Finally, remember that giving users/staff convenience is always easy, taking it away is much harder, so again, don't add it unless you really have to.

link|improve this answer
feedback

I have it installed on my webserver. I have permissions on the directory d--------- unless I need to access it, then I:

  • ssh to the server
  • change perms
  • set an at job to change them back
  • and use a .htaccess file for apache-based login.

I also make sure to keep it updated.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.