How To Reset root Password on CentOS VM – XenServer

Basic steps are as follows.

  1. Shutdown VM
  2. From XenCenter, insert the CentOS iso into the VM’s Virtual DVD drive.
  3. Boot the CentOS VM in recovery mode.  If you need help with that check this post out.
  4. On the grub menu, select recover OS Installation.
  5. Run through the recovery and mount the VM’s disk where CentOS is installed
  6. You should now be able to drop to a prompt and chroot /sysimage
  7. Change the root password with passwd
  8. Shutdown the VM
  9. Eject the CentOS iso
  10. Boot up the VM and login with the new password

Reset WordPress admin password in MySQL

Log into MySQL from command line

mysql -u root -p

Select the correct database

USE wordpress_db;

Print current users

SELECT * FROM wp_users;

Should get something similar to the following

mysql> SELECT * FROM wp_users
-> ;
+----+------------+------------------------------------+---------------+---------------------------+----------+---------------------+------------------------------------+-------------+--------------+
| ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
+----+------------+------------------------------------+---------------+---------------------------+----------+---------------------+------------------------------------+-------------+--------------+
| 1 | admin | 5f4dcc3b5aa765d61d8327deb882cf99 | admin | bob@incredigeek.com | | 2018-08-09 10:10:42 | | 0 | admin |
| 2 | bob | 210805fb52a13251f4bedc7e725e575a | bob | bob@incredigeek.com | | 2019-11-01 11:31:23 | | 0 | bob smith |
+----+------------+------------------------------------+---------------+---------------------------+----------+---------------------+------------------------------------+-------------+--------------+
3 rows in set (0.00 sec)
mysql>

To update the password use

UPDATE wp_users SET user_pass = MD5('NewPass') WHERE ID=1;

The MD5 hashes the NewPass and adds it to the database. You can print the users again to verify the hash changed.

You should now be able to login using the new password you configure.

How to Reset an OS X Password

You first need to boot your Mac into single user mode by booting it up while holding down the “command+s” keys.

Once your in Single User Mode type in

mount -uw /

That will mount your Mac hard drive. Now run

launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist

and now you can change the password.  Replace “username” and “password” with the username for the user and the new password.

dscl . passwd /Users/username password

Now you can reboot the machine

reboot

and log in with the new password.

Reset Root Password for FreeBSD

Boot up FreeBSD, when you get to the FreeBSD boot menu select “Boot FreeBSD in single user mode”

When you get to the following prompt hit enter.

When prompted Enter full pathname of shell or RETURN for /bin/sh:

You will now be booted in single user mode.

Run the following commands to mount the root drive as read and write.

mount -u /
mount -a

Now reset the root password with passwd

passwd root

Your now finished. You can type in “exit” to continue booting, or you can just reboot.