Securing phpmyadmin installation

  • Posted April 1, 2013

Hello all,

I’m a complete noob but I can follow instructions quite well… :) I was following the article on how the install and secure the phpmyadmin installation on Ubuntu until I hit an error: When I run the command sudo htpasswd -c /home/myusername/passwd/.htpasswd username I get error “cannot create file /home/myusername/passwd/.htpasswd” I double checked the .htaccess file and the AuthUserFile matches the path above. In the .htaccess file what I have is: AuthUserFile /home/myusername/passwd/.htpasswd As far as I can see the paths are identical. I’d appreciate your help on this as I cannot figure this out.

Thank you in advance, Goran


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

BTW: I hope you access/allow phpmyadmin only via https, otherwise securing it via a password (.htpasswd) is pointless.

You should not use phpmyadmin on a production server. Phpmyadmin makes only sense when you have a shared hosting plan which does not allow you to login via ssh to access the database. On your own server, where you can login with ssh, there is no need at all to use and install phpmyadmin. Using phpmyadmin is a big security risk, since due to misconfiguration of your webserver your database and all user credidentials are wide open to any attacker. And attacks against phpmyadmin are on the top of the list of each hacker, who comes along your website.

Solved it. <br>For some reason it would not let me put the .htpasswd file in /home/myusername/passwd/.htpasswd but it let me put it in /home/myusername/.htpasswd