Difference between revisions of "Root Password Reset"
From PrgmrWiki
(→Latest Management Console) |
m (Srn moved page Password Reset to Root Password Reset: Password reset could refer to other systems) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | The prgmr.com rescue image can be used to reset the root password for your VPS just as you might use a live CD. If you run BSD, you can also boot the appropriate BSD installer and follow a similar process. | |
− | |||
− | The prgmr.com rescue image can be used to reset the root password for your VPS just as you might use a | ||
=Boot Into Rescue Mode= | =Boot Into Rescue Mode= | ||
− | Shut down your VPS and boot into the rescue mode using the [[Management Console]] | + | Shut down your VPS and boot into the rescue mode using the [[Management Console]]: |
− | |||
− | |||
− | |||
<pre> | <pre> | ||
Line 16: | Line 11: | ||
4. force power off (destroy/hard shutdown) | 4. force power off (destroy/hard shutdown) | ||
5. reboot (shutdown + start) | 5. reboot (shutdown + start) | ||
− | 6. set bootloader | + | 6. set bootloader, rescue mode, or netboot installer |
7. view/add/remove ssh authorized_keys | 7. view/add/remove ssh authorized_keys | ||
8. view/edit reverse dns | 8. view/edit reverse dns | ||
9. install new OS image | 9. install new OS image | ||
a. system details | a. system details | ||
− | + | b. maintenance options | |
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | Select | + | <li>Select "system details" and note what "Boot option:" says. Normally this will be set to "Disk".</li> |
− | + | <li>Select "shutdown" to shut down your VPS.</li> | |
− | |||
− | + | When the system shuts down and returns to the console, use option "set bootloader, rescue mode, or netboot installer" and proceed from there. Depending on your VPS type, you will be presented with one of two menus: | |
− | |||
<pre> | <pre> | ||
− | |||
− | |||
− | |||
− | |||
Options: | Options: | ||
1. Boot from disk | 1. Boot from disk | ||
Line 46: | Line 31: | ||
4. Linux netboot installers - rescue mode | 4. Linux netboot installers - rescue mode | ||
5. BSD installers | 5. BSD installers | ||
+ | </pre> | ||
− | + | or | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
− | |||
− | |||
− | |||
− | |||
Options: | Options: | ||
1. GRUB legacy(pv-grub) | 1. GRUB legacy(pv-grub) | ||
Line 67: | Line 43: | ||
5. Linux netboot installers - rescue mode | 5. Linux netboot installers - rescue mode | ||
6. BSD netboot installers | 6. BSD netboot installers | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | Select Linux-based Live Rescue | + | <li>Select Linux-based Live Rescue if you run Linux, otherwise choose the appropriate BSD installer.</li> |
− | |||
− | |||
− | |||
− | |||
− | < | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <li>Go back to the main menu and select "create/start".</li> | |
− | < | ||
− | |||
− | </ | ||
− | |||
==Reset Your Password== | ==Reset Your Password== | ||
Line 112: | Line 53: | ||
<li>When the rescue image is finished booting, log in as root at the prompt with no password (this example uses the Linux-based Live Rescue):</li> | <li>When the rescue image is finished booting, log in as root at the prompt with no password (this example uses the Linux-based Live Rescue):</li> | ||
<pre> | <pre> | ||
− | |||
− | |||
rescue login: root | rescue login: root | ||
− | Linux rescue | + | Linux rescue 4.9.0-12-amd64 #1 SMP Debian 4.9.210-1 (2020-01-20) x86_64 |
− | + | To manually enable ssh access to the rescue image, copy | |
− | |||
− | |||
− | To enable ssh access to the rescue image, copy | ||
your public key to /root/.ssh/authorized_keys and type | your public key to /root/.ssh/authorized_keys and type | ||
"service ssh start" | "service ssh start" | ||
− | root@rescue:~#</pre> | + | root@rescue:~# |
+ | </pre> | ||
<li>Mount your root filesystem (by default /dev/xvda1) and chroot to it:</li> | <li>Mount your root filesystem (by default /dev/xvda1) and chroot to it:</li> | ||
<pre> | <pre> | ||
− | root@rescue:~# mount /dev/xvda1 /mnt | + | root@rescue:~# mount /dev/xvda1 /mnt/ |
− | [ | + | [ 60.024137] EXT4-fs (xvda1): mounted filesystem with ordered data mode. Opts: (null) |
− | + | root@rescue:~# chroot /mnt/ | |
− | root@rescue:~# chroot /mnt | + | </pre> |
− | |||
<li>Change the root password with passwd:</li> | <li>Change the root password with passwd:</li> | ||
<pre> | <pre> | ||
− | + | root@rescue:/# passwd | |
Enter new UNIX password: | Enter new UNIX password: | ||
Retype new UNIX password: | Retype new UNIX password: | ||
passwd: password updated successfully | passwd: password updated successfully | ||
− | [root@rescue / | + | </pre> |
+ | |||
+ | <li>If you are using CentOS or Fedora, mark the file system for [https://wiki.centos.org/HowTos/SELinux#Relabel_Complete_Filesystem selinux autorelabeling]:</li> | ||
+ | <pre> | ||
+ | root@rescue:/# touch /.autorelabel | ||
+ | </pre> | ||
+ | |||
<li>Exit, unmount, and shutdown:</li> | <li>Exit, unmount, and shutdown:</li> | ||
<pre> | <pre> | ||
Line 145: | Line 87: | ||
Starting Synchronise Hardware Clock to System Clock... | Starting Synchronise Hardware Clock to System Clock... | ||
</pre> | </pre> | ||
− | <li>This will return you to the Management Console. | + | <li>This will return you to the Management Console. You need to set the system to boot normally again. Go to the "set bootloader, rescue mode, or netboot installer" menu and select your original boot option.</li> |
+ | <li>Go back to the main menu.</li> | ||
+ | <li>Start the VPS again using "create/start."</li> | ||
</ol> | </ol> | ||
{{c|for Users}} | {{c|for Users}} | ||
{{c|Prgmr}} | {{c|Prgmr}} |
Latest revision as of 19:01, 19 May 2020
The prgmr.com rescue image can be used to reset the root password for your VPS just as you might use a live CD. If you run BSD, you can also boot the appropriate BSD installer and follow a similar process.
Boot Into Rescue Mode
Shut down your VPS and boot into the rescue mode using the Management Console:
Options: 1. out of band console (press ctrl-] to escape, not resizeable) 2. create/start, opens OOB console (try this if the machine is not running) 3. shutdown (requests clean shutdown, forces off after 4 min) 4. force power off (destroy/hard shutdown) 5. reboot (shutdown + start) 6. set bootloader, rescue mode, or netboot installer 7. view/add/remove ssh authorized_keys 8. view/edit reverse dns 9. install new OS image a. system details b. maintenance options
When the system shuts down and returns to the console, use option "set bootloader, rescue mode, or netboot installer" and proceed from there. Depending on your VPS type, you will be presented with one of two menus:
Options: 1. Boot from disk 2. Linux-based Live Rescue 3. Linux netboot installers - install mode 4. Linux netboot installers - rescue mode 5. BSD installers
or
Options: 1. GRUB legacy(pv-grub) 2. GRUB2 3. Linux-based Live Rescue 4. Linux netboot installers - install mode 5. Linux netboot installers - rescue mode 6. BSD netboot installers
Reset Your Password
- When the rescue image is finished booting, log in as root at the prompt with no password (this example uses the Linux-based Live Rescue):
- Mount your root filesystem (by default /dev/xvda1) and chroot to it:
- Change the root password with passwd:
- If you are using CentOS or Fedora, mark the file system for selinux autorelabeling:
- Exit, unmount, and shutdown:
- This will return you to the Management Console. You need to set the system to boot normally again. Go to the "set bootloader, rescue mode, or netboot installer" menu and select your original boot option.
- Go back to the main menu.
- Start the VPS again using "create/start."
rescue login: root Linux rescue 4.9.0-12-amd64 #1 SMP Debian 4.9.210-1 (2020-01-20) x86_64 To manually enable ssh access to the rescue image, copy your public key to /root/.ssh/authorized_keys and type "service ssh start" root@rescue:~#
root@rescue:~# mount /dev/xvda1 /mnt/ [ 60.024137] EXT4-fs (xvda1): mounted filesystem with ordered data mode. Opts: (null) root@rescue:~# chroot /mnt/
root@rescue:/# passwd Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
root@rescue:/# touch /.autorelabel
[root@rescue /]# exit exit root@rescue:~# umount /mnt root@rescue:~# shutdown -h now Starting Synchronise Hardware Clock to System Clock...