Securing phpMyAdmin with htaccess
Posted: Fri May 15, 2020 8:20 am
I just did it so i figured I'd share the process unless someone wants to do it:
If anyone tries it please let me know if it works for u so i know if i need to alter the instructions at all, thx
-Nox
- Code: Select all
####Securing phpMyAdmin#####
nano /etc/apache2/conf.d/phpMyAdmin.conf
###change the following:
<Directory /usr/share/phpMyAdmin>
Options FollowSymLinks
AllowOverride All #This was "None"
<IfVersion < 2.4>
Order Deny,Allow
Allow from all
</IfVersion>
###save and exit
nano /usr/share/phpMyAdmin/.htaccess
####Enter the following:
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/phpMyAdmin/.htpasswd
Require valid-user
###save and exit
zypper install apache2-utils
htpasswd -c /etc/phpMyAdmin/.htpasswd whatever.username.u.want
Password: enter the password u want
##restart apache
service apache restart or systemctl restart apache
###go to your phpmyadmin
http://server.ip/phpMyAdmin
##Enjoy
If anyone tries it please let me know if it works for u so i know if i need to alter the instructions at all, thx
-Nox