5

This isn't a huge deal, because there's very little on the server (literally a file or two) that we actually need off of it. But we disabled root logins as a security measure and can't remember any of our other user passwords.

I'm assuming that there's nothing we can do at this point to get into the server? I'm sitting next to the box...

Update

Oops... actually, I need to export an SVN off of this server. So yeah, there's stuff I need.

Update

I should point out, we're on Debian Lenny

1
  • You really need to develop a sane approach to user account and password management, which should include at least one account who's credentials are securely stored for just such on occasion. Apr 15, 2010 at 21:46

5 Answers 5

12

Booting in single user mode won't work for Debian and Ubuntu because you still have to enter the root password for maintenance mode.

Reboot your computer to get to the grub boot screen, press e to edit one of your Grub boot configurations and edit the line starting with kernel. Append init=/bin/sh and boot the modified configuration by pressing b. When you arrived in your shell (without logging in this time) remount your file-system so it's in read/write mode: mount -o remount,rw /. Now you can start changing passwords with passwd now :)...

6

I will assume you are using Grub for you boot loader:

  1. Boot your system
  2. Select your kernel
  3. Press e
  4. Select the line that begins with kernel
  5. Append the letter S to the end of the line
  6. Press Enter then b

Boot into your single user mode.You should be greeted with the root prompt #. From here:

  1. type the command passwd and reset the root password
  2. Reboot. And login as root like normal

It would be really helpful if you could post a few details about your system. Which distro? Which bootloader?

Good luck!

Well ... Your other option is:

  1. Boot off of a rescue LiveCD
  2. Mount the root partition
  3. edit /etc/shadow (Delete everything between the first two colons in the root entry [see below])
  4. Then reboot and login to root without a password.
  5. Run the command passwd and reset the root password.

From this:

root:19udHWuh!:12581:0:99999:7:::

To this:

root::12581:0:99999:7:::

More info can be found at the Arch Linux wiki.

2
2

Boot into runlevel 1. Pass 1 as an extra argument on the kernel line from the bootloader.

3
  • 1
    I'm a bit of a newbie.... could you go into more detail as to how to do that?
    – Ben
    Apr 15, 2010 at 18:50
  • The exact process depends on which bootloader is being used. Apr 15, 2010 at 18:54
  • @Webnet: Select the entry you want to boot into from the menu, then press a instead of Enter. Type a space, then 1, then press Enter. Apr 15, 2010 at 19:02
1

If you have physical access to the server, you can always boot from a rescue disc, or even a liveCD and mount the old filesystem to copy the important stuff off.

0

ok, at boot time press esc to get the grub menu to appear ( just bang on esc key as it begins boot ) and then edit the menu line to a ' single' to the end of it. Or you can choose Rescue mode, this will also let you do recovery as well.

this will drop you in at a shell prompt, you can then change your password via passwd command or bring up network manually ( ifup eth0 ) and move the files off the machine from single user mode.

this is for redhat style os

capiche?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .