Reset password manually in OnApp

Reset password manually in OnApp

When password reset in onApp fails or does not work you can manually reset the password with the following process
  1. Reboot in recovery.
  2. Login via recovery with user/password being root/recovery or root/defaultrootpassword <-- could be either one, depends on if it was able to set it to the default or not.
  3. fdisk -l #Check for the disk that has the same size as the one this VM has. ex: 50GB, you'll probably see 49.something GB here, but that's the one. Normally it's /dev/vda or /dev/xvda, depends on the distribution. It will also show the partitions, and it will more than likely be the /dev/vda1 partition.
  4. Mount that disk. I like to create a directory under /mnt for this: mkdir /mnt/vda1 and then mount it like this: mount /dev/vda1 /mnt/vda1
  5. Now we need to make that environment usable. We need to bind /proc, /sys, and /dev to that environment. Like this:

mount --bind /proc /mnt/vda1/proc

mount --bind /sys /mnt/vda1/sys

mount --bind /dev /mnt/vda1/dev

  1. Now we can 'change root' to that environment: chroot /mnt/vda1
  2. If we check our pwd, we'll have / because we're in the root of this environment now. Double check you're still root with whoami and then you can run passwd and update the password for the root user.
  3. Use exit to leave the environment and go back to the recovery image. Unmount binds and disk cd / ; umount /mnt/vda1/proc ; umount /mnt/vda1/dev ; umount /mnt/vda1/sys ; umount /mnt/vda1

I put the cd in there to remind you to make sure you're not in the directory you're unmounting or it won't unmount.

Restart the machine and it should allow you in with the password you've set it to.

    • Related Articles

    • Reset mysql password

      First try to see if you can login to mysql as root. ssh to root user, or su root from AD login.       mysql If you get an error similar to: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Then the password is ...
    • Manually Resetting Wordpress Password

      In WordPress, there is more than one way to set your password. In normal circumstances, you can do it through the WordPress interface. If you forget your password, WordPress has a built in recovery mechanism that uses email. But on some hosts, ...
    • Password protect directory in cPanel

      1. Log in to your cPanel account > Files section > Directory Privacy menu:  2. Select Document Root for option and the domain name in question from the drop-down menu, and hit Go:  3. Once there, you may pick up the directory you wish to protect:  4. ...
    • Password restrictions when creating Exchange mailbox

      User receives the following error when trying to create an Exchange mailbox: Failed to add Mailbox MBNAME The password doesn't meet requirements on Winbox. The requirements are 1 lowercase and 1 upper case letter as well as 1 number.
    • Password Protection for Hsphere Windows Directories

      If you are in a Shared Windows HSPHERE environment and wish to  password protect a directory please follow these steps:   1. Create a sub-ftp account via your h-sphere control panel. This can be found under >FTP/User Account>FTP User>FTP sub-accounts ...