7

I migrated an old Joomla 1.5 site to a shiny new Joomla 3.3 version using the tool SP UPGRADE.

Now I can't seem to login and I fear its because all the user passwords in the DB look like 'MD5':'Salt' which is the old way to create passwords.

I understand the newer code uses a based password. All of the methods I see described about pasting in the old style 'secret' password are not working.

How do I reset a password in Joomla 3.3?

9

Here is a workaround to temporary reset your password for your account.

  1. Login to your hosting panel and use the database tool that is available (probably PHPmyAdmin).

  2. Load the appropriate database and then go to the jos_users table. (The database prefix might be different for your case).

  3. Go to the browse view of the PHPmyAdmin, so you get view of the users records.
  4. Locate your account and click to edit, or click directly in the 'password' field (Usually PHPmyAdmin, will make the field editable with this).
  5. In the password field paste the value below:

$2y$10$JszAMznv7U2Q4VETQdw7n.CX/HPekafC8sxa9.n0V2gp/t/.xvHYi

  1. Do not apply any special functions for saving the field and it will set your account password to admin. Save the record.

You can now login with your account, using as password: admin.

After login, make sure you set your desired password.

  • Yeah, that worked, but how did you derive the password value? – tgunr Sep 16 '14 at 12:04
  • I simply took it from another established database, from a user that has admin as password. – FFrewin Sep 16 '14 at 17:06
7

In addition to FFrewin's fine answer, here's a couple of alternative ways to reset the admin password.

Notice
Remember that most of these methods will set your password to something simple like admin. It's very important to set a stronger password afterwards. If there is reason to believe the site has been hacked, you might want to remove other users with admin access once you've recovered access to your Joomla installation.
These methods are partly taken from Joomla Docs.

Alternative 1: Configuration.php file

If you are able to log in with another user (without super-admin rights), it is possible to add this line to the bottom of the configuration.php file in your Joomla root directory:

public $root_user='myname';

Replace myname with the username of any user you know the password of (with Author rights or higher). This user will now be able to log in as superadministrator, and you can edit/add users in the user manager. Remember to remove the extra line from your configuration.php file when you're done, either by letting Joomla try to do it automatically when prompted, or by editing the file manually.

Alternative 2: Add new Super-admin user

A new super-administrator user can be created using this method:

  1. Open phpMyAdmin (or similar, depending on your hosting) and select the database for the Joomla! site.
  2. Press the "SQL" button in the toolbar to run an SQL query on the selected database. This will display a field called "Run SQL query/queries on database ". Delete any text in this field and copy and paste the following query below and press the Go button to execute the query and add the new Administrator user to the table:

    INSERT INTO `jos31_users`
    (`name`, `username`, `password`, `params`)
    VALUES ('Administrator2', 'admin2',
    'd2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199', '');
    INSERT INTO `jos31_user_usergroup_map` (`user_id`,`group_id`)
    VALUES (LAST_INSERT_ID(),'8');
    
  3. Remember to replace the two occurrences of jos31_ with the prefix used by your Joomla installation (this is usually easily spotted in phpMyAdmin).

  4. You can now access your site with username admin2 and password secret. Make sure to edit your password once you've logged in.

Alternative 3:

Create a PHP file with the code below, upload it to your JOOMLAROOT/administrator directory, and run it in your browser. It will log you in instantly (both Joomla 2.5 and 3), and allow you to add/edit users. Remember to remove the file once you're done. Failure to do so will represent a huge security issue.

The tool can also be found here: http://myext.eu/en/j25-login

<?php
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);

if (file_exists(dirname(__FILE__) . '/defines.php')) {
    include_once dirname(__FILE__) . '/defines.php';
}

if (!defined('_JDEFINES')) {
    define('JPATH_BASE', dirname(__FILE__));
    require_once JPATH_BASE.'/includes/defines.php';
}

require_once JPATH_BASE.'/includes/framework.php';
require_once JPATH_BASE.'/includes/helper.php';
require_once JPATH_BASE.'/includes/toolbar.php';
$app = JFactory::getApplication('administrator');
JPluginHelper::importPlugin('user');
$user = JUser::getInstance();
$db = JFactory::getDBO();
$q = 'SELECT u.* FROM `#__users` as u
        LEFT JOIN `#__user_usergroup_map` as ug ON u.id = ug.user_id
        WHERE `block` = 0 AND `activation` = 0 AND ug.group_id = 8
        LIMIT 0,1';
$db->setQuery($q);

$user_tmp = $db->loadObject();
$user_tmp->guest = 0;
$user_tmp->isRoot = 1;
// $user_tmp->groups = array(8=>8);
// $user_tmp->_authGroups = array(1,8);
// $user_tmp->_authLevels = array(1,1,2,3);
// $user_tmp->gid = 1000;

foreach($user_tmp as $k=>$v){
    $user->set($k,$v);
}
$session = JFactory::getSession();
$session->set('user', $user);
$app = JFactory::getApplication();
$app->checkSession();
$app->redirect( JUri::base(), "" );

Not the answer you're looking for? Browse other questions tagged or ask your own question.