Difference between revisions of "Single User Mode"

From Noah.org
Jump to navigationJump to search
Line 1: Line 1:
 
[[Category:engineering]]
 
[[Category:engineering]]
 +
 
== Root password recovery in Single User Mode ==
 
== Root password recovery in Single User Mode ==
If you need to reset the root password then you must have access to the console.
 
This is easy with VMWare or a Remote Access Controller. If not then you will have to make a physical trip to your server room.
 
  
Note that with Ubuntu you usually don't want to set a root password.
+
If you need to reset the root password then you must have access to the console. This is easy with VMWare or a Remote Access Controller. If not then you will have to make a physical trip to your server room.
Just use "sudo su -" to get a root shell. If you do set a root password
+
 
and then forget it then you will have to use the second method described below.
+
Note that with Ubuntu you usually don't want to set a root password. Just use "sudo su -" to get a root shell. If you do set a root password and then forget it then you will have to use the second method described below.
  
 
=== Boot into Single User Mode ===
 
=== Boot into Single User Mode ===
  
1. Boot your Linux box and start hitting 'Esc' until you get the GRUB menu.
+
1. Boot your Linux box and start hitting 'Esc' until you get the GRUB menu. The GRUB menu passes by quickly. This can be a pain over VMWare so you might have to reboot a few times before you catch it.
The GRUB menu passes by quickly. This can be a pain over VMWare so  
 
you might have to reboot a few times before you catch it.
 
  
 
2. Select a boot image from the menu then press 'e' to edit.
 
2. Select a boot image from the menu then press 'e' to edit.
  
3. Select the Kernel line and press 'e' to edit.
+
3. Select the Kernel line and press 'e' to edit. It should look something like this:
It should look something like this:
 
 
     kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root ro quiet splash
 
     kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root ro quiet splash
 
Edit the line to get rid of quiet and splash and add 'single':
 
Edit the line to get rid of quiet and splash and add 'single':
Line 23: Line 19:
  
 
4. Then press enter. You will be returned to the menu.  
 
4. Then press enter. You will be returned to the menu.  
 +
 
5. Press 'b' to boot with these new settings.
 
5. Press 'b' to boot with these new settings.
  
Line 32: Line 29:
 
=== Single User Mode without root password for maintenance ===
 
=== Single User Mode without root password for maintenance ===
  
This method will get you past the "Give root password for maintenance" message, but the environment will be much more primitive, but this should be enough for
+
This method will get you past the "Give root password for maintenance" message, but the environment will be much more primitive, but this should be enough for you to issue a 'passwd' command to change the password for root. If you want to do more than that then you may have to mount filesystems and manually start the network.  
you to issue a 'passwd' command to change the password for root.  
 
If you want to do more than that then you may have to mount filesystems  
 
and manually start the network.  
 
  
 
1. Reboot your machine; press 'Esc' to get to the GRUB menu; select your image; press 'e' to edit; select the Kernel line.
 
1. Reboot your machine; press 'Esc' to get to the GRUB menu; select your image; press 'e' to edit; select the Kernel line.
  
2. Press 'e' to edit the kernel line. Edit the line to get rid of quiet and splash;
+
2. Press 'e' to edit the kernel line. Edit the line to get rid of quiet and splash; change 'ro' to 'rw'; and add 'init=/bin/bash'. The line should look something like this:
change 'ro' to 'rw'; and add 'init=/bin/bash'. The line should look something like this:
 
 
     kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root rw init=/bin/bash
 
     kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root rw init=/bin/bash
  
 
3. Press 'enter' then 'b' to boot with these new settings.
 
3. Press 'enter' then 'b' to boot with these new settings.

Revision as of 17:54, 5 November 2007


Root password recovery in Single User Mode

If you need to reset the root password then you must have access to the console. This is easy with VMWare or a Remote Access Controller. If not then you will have to make a physical trip to your server room.

Note that with Ubuntu you usually don't want to set a root password. Just use "sudo su -" to get a root shell. If you do set a root password and then forget it then you will have to use the second method described below.

Boot into Single User Mode

1. Boot your Linux box and start hitting 'Esc' until you get the GRUB menu. The GRUB menu passes by quickly. This can be a pain over VMWare so you might have to reboot a few times before you catch it.

2. Select a boot image from the menu then press 'e' to edit.

3. Select the Kernel line and press 'e' to edit. It should look something like this:

   kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root ro quiet splash

Edit the line to get rid of quiet and splash and add 'single':

   kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root ro single

4. Then press enter. You will be returned to the menu.

5. Press 'b' to boot with these new settings.

If if appears to boot normally, but you see a message that says:

   Give root password for maintenance
   (or type Control-D to continue):

then you will have to try a different trick below.

Single User Mode without root password for maintenance

This method will get you past the "Give root password for maintenance" message, but the environment will be much more primitive, but this should be enough for you to issue a 'passwd' command to change the password for root. If you want to do more than that then you may have to mount filesystems and manually start the network.

1. Reboot your machine; press 'Esc' to get to the GRUB menu; select your image; press 'e' to edit; select the Kernel line.

2. Press 'e' to edit the kernel line. Edit the line to get rid of quiet and splash; change 'ro' to 'rw'; and add 'init=/bin/bash'. The line should look something like this:

   kernel /vmlinuz-2.6.15-27-386 root=/dev/mapper/Ubuntu-root rw init=/bin/bash

3. Press 'enter' then 'b' to boot with these new settings.