Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I was doing some experiment about resource-accessing. By mistake, I executed this command, $ sudo mv /etc/passwd /etc/passwd.bak Then I could not execute any command with privilege(eg. sudo mv /etc/passwd.bak /etc/passwd). When I shut the system down, I could not boot it any more. Afterwards, I restored the passwd file with a LiveCD. Any other approaches could make it?

share|improve this question

migrated from Sep 19 '10 at 14:47

This question came from our site for professional and enthusiast programmers.

Maybe this: When the bootloader shows up, add


to the kernel parameters. Instead of booting normally (with the init process spawning all the other services including login), you should end up in single-user mode with a root shell (no password is asked) and be able to restore the passwd file. On some distributions you may need to manually remount the root partition in read/write mode before moving the file:

mount -o remount,rw /dev/sda123

(I don't want to test your issue and see if this solution works :)

share|improve this answer
That seems to be available. I will test it myself. Thanks a lot. – dutor Sep 18 '10 at 2:04

You can use "sudo su" to keep a root terminal open. That way, there is no need to login with sudo each and every time, as the terminal will always be root (until you close it, of course). If you accidental move the file, you can move it back from the root terminal because you'll still be logged in.

share|improve this answer
I did that by mistake, so I didn't realize what would happen next. – dutor Sep 18 '10 at 2:01

Your Answer


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