Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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...


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


I should point out, we're on Debian Lenny

share|improve this question
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. – John Gardeniers Apr 15 '10 at 21:46
up vote 12 down vote accepted

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 :)...

share|improve this answer

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:


To this:


More info can be found at the Arch Linux wiki.

share|improve this answer
That works, except that it takes us to a login prompt.... it's supposed to according to: – Webnet Apr 15 '10 at 20:08
Added an alternate method. – Joseph Kern Apr 15 '10 at 20:17

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

share|improve this answer
I'm a bit of a newbie.... could you go into more detail as to how to do that? – Webnet Apr 15 '10 at 18:50
The exact process depends on which bootloader is being used. – Ignacio Vazquez-Abrams Apr 15 '10 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. – Ignacio Vazquez-Abrams Apr 15 '10 at 19:02

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.

share|improve this answer

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


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.