# How do I secure PHPmyadmin?



## AhrenBa (Jul 21, 2005)

Hello,

I have PHPmyadmin installed on my 1&1 server with the config "auth" method. If I understand correctly, anyone can access my phpmyadmin. How do I go about securing it and putting a password on it? Thank you.

EDIT: I am using 1&1 beginner so I do not have telnet/SSH access.


----------



## covert215 (Apr 22, 2006)

Find the config.inc.php file and change the line:

```
$cfg['Servers'][$i]['auth_type'] = 'config';
```
To

```
$cfg['Servers'][$i]['auth_type'] = 'http';
```
This will require you to enter the database login details to use PMA.


----------



## AhrenBa (Jul 21, 2005)

covert215 said:


> Find the config.inc.php file and change the line:
> 
> ```
> $cfg['Servers'][$i]['auth_type'] = 'config';
> ...


Cool, thank you. But wouldn't this mean that anyone who knows how to get access to the config.inc.php file on the server could get my password since it is contained in that file?

Is there any other way to do it, by possibly making a new password that will protect the whole program?


----------



## covert215 (Apr 22, 2006)

You can make password protected directories.

But you can't access a php file from the server. It will appear as a blank file.


----------



## AhrenBa (Jul 21, 2005)

covert215 said:


> You can make password protected directories.
> 
> But you can't access a php file from the server. It will appear as a blank file.


How do I make pw protected directories? Thanks


----------



## covert215 (Apr 22, 2006)

Use .htaccess files.


----------



## AhrenBa (Jul 21, 2005)

covert215 said:


> Use .htaccess files.


Ahh! I see . What type of code do you put in those types of files, PHP? HTML? Thanks


----------



## covert215 (Apr 22, 2006)

http://www.tools.dynamicdrive.com/password/


----------



## covert215 (Apr 22, 2006)

Anyways, I would recommend editing the config file.


----------



## AhrenBa (Jul 21, 2005)

covert215 said:


> Anyways, I would recommend editing the config file.


Ok, cool, I might as well do that. Thanks for your help.


----------

