Difference between revisions of "Root Password Reset"

From PrgmrWiki
(fix markup)
Line 2: Line 2:
  
 
<ol>
 
<ol>
<li>If the vps (domU or domain) is still running, shut it down with the menu on the host server (dom0).
+
<li>If the vps (domain) is still running, shut it down using the [[Prgmr menu]].
 
<pre>
 
<pre>
 
Name                                        ID  Mem VCPUs      State  Time(s)
 
Name                                        ID  Mem VCPUs      State  Time(s)
Line 8: Line 8:
  
 
Options for build
 
Options for build
1. console
+
1. out of band console (press ctrl-] to escape, not resizeable)
2. create/start
+
2. create/start (try this if the vps "does not exist")
 
3. shutdown
 
3. shutdown
 
4. destroy/hard shutdown
 
4. destroy/hard shutdown
 
5. reboot
 
5. reboot
6. exit
+
6. swap i386/amd64 bootloaders (pvgrub) currently i386
 +
7. view/add/remove ssh authorized_keys
 +
8. set reverse dns
 +
9. exit
 
press the number> 3
 
press the number> 3
 
</pre> This will signal the domain to safely shutdown like the shutdown command.</li>
 
</pre> This will signal the domain to safely shutdown like the shutdown command.</li>
Line 26: Line 29:
 
                                                                            
 
                                                                            
 
Options for build                                                         
 
Options for build                                                         
1. console                                                              
+
1. out of band console (press ctrl-] to escape, not resizeable)
2. create/start                                                          
+
2. create/start (try this if the vps "does not exist")
3. shutdown                                                              
+
3. shutdown
4. destroy/hard shutdown                                                
+
4. destroy/hard shutdown
5. reboot                                                                
+
5. reboot
6. exit                                                                  
+
6. swap i386/amd64 bootloaders (pvgrub) currently i386
 +
7. view/add/remove ssh authorized_keys
 +
8. set reverse dns
 +
9. exit
 
press the number> 2     
 
press the number> 2     
 
</pre>
 
</pre>
The vps will start booting with pvgrub and will load the grub menu from the rescue image:
+
The domain will start booting with pvgrub and will load the grub menu from the rescue image:
 
<pre>
 
<pre>
 
      
 
      
Line 40: Line 46:
 
   
 
   
 
  +-------------------------------------------------------------------------+
 
  +-------------------------------------------------------------------------+
  | user domU bootloader                                                   |
+
  | user bootloader configuration                                          |
  | CentOS rescue (2.6.18-164.6.1.el5xen)                                   |
+
  | CentOS 5.5 rescue (2.6.18-194.3.1.el5xen)                               |
  | CentOS 5.4 installer                                                    |
+
  | CentOS 5.5 installer                                                    |
  | NetBSD 5.0.1 installer                                                 |
+
  | Ubuntu 10.04 LTS installer                                             |
 
  |                                                                        |
 
  |                                                                        |
 
  |                                                                        |
 
  |                                                                        |

Revision as of 21:21, 28 March 2014

The prgmr.com rescue image can be used to reset the root password for the vps similar to a rescue disk like tomsrtbt or the debian installer rescue mode. If you run netbsd, you can also boot the netbsd installer from the rescue disk for a similar process.

  1. If the vps (domain) is still running, shut it down using the Prgmr menu.
    Name                                        ID   Mem VCPUs      State   Time(s)
    build                                      447  1024     1     -b----     16.6
    
    Options for build
    1. out of band console (press ctrl-] to escape, not resizeable)
    2. create/start (try this if the vps "does not exist")
    3. shutdown
    4. destroy/hard shutdown
    5. reboot
    6. swap i386/amd64 bootloaders (pvgrub) currently i386
    7. view/add/remove ssh authorized_keys
    8. set reverse dns
    9. exit
    press the number> 3
    
    This will signal the domain to safely shutdown like the shutdown command.
  2. When it is stopped running, opening the menu will say
    Error: Domain 'build' does not exist.
    
    which is normal, it just means the vps isn't running. Choose create to start the vps:
    
    Error: Domain 'build' does not exist.                                     
                                                                              
                                                                              
    Options for build                                                         
    1. out of band console (press ctrl-] to escape, not resizeable)
    2. create/start (try this if the vps "does not exist")
    3. shutdown
    4. destroy/hard shutdown
    5. reboot
    6. swap i386/amd64 bootloaders (pvgrub) currently i386
    7. view/add/remove ssh authorized_keys
    8. set reverse dns
    9. exit
    press the number> 2     
    

    The domain will start booting with pvgrub and will load the grub menu from the rescue image:

        
        GNU GRUB  version 0.97  (1048576K lower / 0K upper memory)
     
     +-------------------------------------------------------------------------+
     | user bootloader configuration                                           |  
     | CentOS 5.5 rescue (2.6.18-194.3.1.el5xen)                               |
     | CentOS 5.5 installer                                                    |
     | Ubuntu 10.04 LTS installer                                              |
     |                                                                         |
     |                                                                         |
     |                                                                         |
     |                                                                         |
     |                                                                         |
     |                                                                         |
     |                                                                         |
     |                                                                         |
     +-------------------------------------------------------------------------+
        Use the ^ and v keys to select which entry is highlighted.
        Press enter to boot the selected OS, 'e' to edit the
        commands before booting, or 'c' for a command-line.
    
  3. Choose CentOS rescue to boot the read only rescue image. When it is finished booting, login as root at the prompt with no password:
    CentOS release 5.4 (Final)
    Kernel 2.6.18-164.6.1.el5xen on an x86_64
    
    build.xen.prgmr.com login: root
    [root@build ~]#
    
  4. Mount your root filesystem (by default /dev/xvda1) and chroot to it:
    [root@build ~]# mount /dev/xvda1 /mnt
    [root@build ~]# chroot /mnt
    build:/#
    
  5. Change the root password with passwd:
    build:/# passwd
    Enter new UNIX password: 
    Retype new UNIX password: 
    passwd: password updated successfully
    build:/#
    
  6. Exit, unmount, and shutdown:
    build:/# exit
    exit
    [root@build ~]# umount /mnt
    [root@build ~]# shutdown -h now
    
    Broadcast message from root (xvc0) (Tue Jan 26 15:33:15 2010):
    
    The system is going down for system halt NOW!
    INIT: Switching to runlevel: 0
    INIT: Sending processes the TERM signal
    
  7. Start the vps again as in step 2, but let it load the vps instead of choosing the rescue image.