TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Secure phpMyAdmin in Linux, Azure Virtual Machine
Talha Bin Afzal
May 14, 2015
6.9
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
In this blog you will learn about to secure phpmyadmin on Linux, Azure virtual machine
Learn how we can install and configure phpmyadmin, there are some security issues with it lets discuss them and there solutions.
Security
phpMyAdmin has serious security vulnerability, allowing user to exploit root on underlying virtual private network. You can prevent these attacks by just locking down the whole directory with a username and password. It will secure you phpMyAdmin.
Set up .htaccess file
In order to setup .htaccess file first you have to get access to apache.conf
Sudo nano /etc/phpmyadmin/apache.conf
You will find a Directory section all you need is to add "
AllowOverride All
" it will look like this. Add.
<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
[. . .]
Configure .htaccess file
With this file we are able to setup a native user to access phpmyadmin.
First create .htaccess page in the phpmyadmin directory
sudo nano /usr/share/phpmyadmin/.htaccess
Now copy and paste following text in it.
AuthType Basic
AuthName
"Restricted File"
AuthUserFile /etc/apache2/.phpmyadmin.htpasswd
Require valid-user
Now restart apache.
sodu service apache2 restart
Create htpasswd file
Now it's time to create valid username and password that you can remember.
Sudo htpasswd –c /etc/apache2/.phpmyadmin.htpasswd username
A prompt will ask you to enter a password and confirm password. Once you are done now restart apache.
Now access phpmyadmin it will ask you to enter username and password that you setup.
Secure phpMyAdmin in Linux
azure VM
Next Recommended Reading
Create And Configure A Virtual Machine For Windows And Linux On Azure