Lost Admin Password with phpmyadmin tutorial Lost Admin Password with phpmyadmin tutorial
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Lost Admin Password with phpmyadmin tutorial

Started by Understudy, April 25, 2008, 02:33:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Understudy

If you have lost your password admin or otherwise. The best way to reset it is with phpmyadmin.
This tutorial will help those who have access to their servers that allow them to do this. If you are paying a monthly fee to a web hosting company for 500MB of webspace you do have proper command access to do this. This is only for those hobby and full time sys admins who would like a clue. Pro admins probably know all this stuff but use part timers learn and some of us share that knowlwdge.

Coppermine does not store passwords in a readable form on some easy to access file. This helps keep nasty people from doing bad things to the coppermine gallery. However if you are absent minded, senile, or suffer from alzheimer's this means you probably no longer know your password.

Now the search function on the coppermine forums is nice but the returns are usually someone saying go to search and type in lost password or lost admin password. This will bring together several good responses. It will probably also get buried on page 27 of the search results. ;)

I use FreeBSD I have root access to my server if you don't this may not be completely helpful.
Currently phpmyadmin is in the ports tree of FreeBSD. It currently installs to /usr/local/www/phpMyAdmin through the ports. I also use apache22. Deal with it.

Start by installing phpmyadmin
cd /usr/ports/databases/phpmyadmin && make install clean && rehash

Once installed

link the directory to where you have your websites main index page not coppermine's index (unless your main page is coppermine).
ln -s  /usr/local/www/phpMyAdmin /usr/local/www/foo.com/public_html/phpMyAdmin <-- yours may vary.

When you install phpmyadmin you need to create an Alias in apache. In /usr/local/etc/apache22/httpd.conf
place the following line to the <IfModule alias_module> section.

Alias /phpmyadmin /usr/local/www/phpMyAdmin

Place this stuff in /usr/local/etc/apache22/httpd.conf at the end of the <Directory> section.
<Directory "/usr/local/www/phpMyAdmin">
        Order allow,deny
        Allow from all
</Directory>

Yes I know if you are doing virtual hosts you might want to modify this, let's keep it simple here.

create a configuration directory.
cd /usr/local/www/phpMyAdmin
mkdir config
chmod 777 config

Restart apache:
/usr/local/etc/rc.d/apache22 restart

link the directory to where you have your websites main index page not coppermine's index (unless your main page is coppermine).
ln -s  /usr/local/www/phpMyAdmin /usr/local/www/foo.com/public_html/phpMyAdmin <-- yours may vary.

Time to configure phpmyadmin.
http://www.foo.com/phpmyadmin/scripts/setup.php  <-- replace foo with your domain or ip
Click on Add Server.
Change the "Authentication type" dropdown to http to have phpMyAdmin prompt you for a username and password.  It will prompt you for your mysql user pass.

Delete root from the "User for config" auth textbox so it is blank.

Leave the other settings blank.

Click the "Add" button to add the new server

Click the Save button in the Configuration section.

Now you have a config file you need to save it in the right place.

cd /usr/local/www/phpMyAdmin <-- if you moved out

cp config/config.inc.php .    <-- that last dot is important, include it.

Now remove the config directory.
rm -rf config

Give the config file proper permissions
chmod 444 config.inc.php

Now you should be able to access your phpmyadmin by going to your browser and typing
http://www.foo.com/phpmyadmin/
Remember you will be prompted for user pass for your mysql. This is not your coppermine user pass I hope.

Once you are in the phpmyadmin you will see the databases on the left.
Click on the db that belongs to coppermine.
On the left you will see the tables.
Now coppermine will tell you your password is stored in xxx_users. Here is where my problem began. I would have thought xxx would have been the version number. In my case it was not. It was pics_users. You must click on the icon to the left of the text or you won't get the right screen.

If you lost your admin password look under the column titled user_id. Look for the 1. That is admin. To the left of that column is a pencil icon (that means edit). Click on it.

You now should have fields you can write in.
to the right of the row called user_pass is the encrypted password. Erase that and fill it with this:
21232f297a57a5a743894a0e4a801fc3
That will make the password admin.
Do not under any circumstances leave the password field blank.
Go to the bottom of the page and just above the light bulb it should say Save. If it does click the go button.
Exit out of phpadmin by going to the exit icon at the upper left corner.

Type in the url of your coppermine page. Login with your user name and the password admin.
Go to users and find your adminstrator name. Click on the edit icon just to the right of your admin name.

Go to the bottom of the page and click on the change my password button. Enter your current password which is admin. Type in your new password. Then retype it. Click the change my password button. If all went well you will see a message saying password successfully change.

You can do the same process for users.

I hope this helps.

Sincerely,
Brendhan


Understudy

Some typos to be fixed. Since there is no modify button for the forums.
If you are paying a monthly fee to a web hosting company for 500MB of webspace you do have proper command access to do this.

Should read as :
If you are paying a monthly fee to a web hosting company for 500MB of webspace you do not have proper command access to do this.

I probably have some more. But it is late here and I am going to bed.

Sincerely,
Brendhan


rcmichelle


Stramm

Why not using the password reminder function (login screen)?

If you really want to use phpmyadmin, then  (usually it's preinstalled... even for free hosting accounts)

1. browse to the cpg database
2. click the xxx_users table (the prefix xxx_ you've chosen when installing coppermine, default is cpg15x_ for 1.5x)
3. click the edit button (pencil) that belongs to your admin accounts user_name
4. in the row user_password select md5 in the function dropdown and enter your password in plain text into the value field
5. hit save
6. login using the password you just have typed in

Congloged

I have uploaded a Coppermine gallery to my site through Fantastico. I hadn't updated it in quite a while and when I went there last week in order to delete a user, I couldn't log in. It seems that it doesn't recognize me, not only as the admin of the gallery but also as a user!
SSD dedicated server with top-notch reliability and security from Softsys Hosting. Order online.