Categories
- Chronicles (59)
- Community and Society (91)
- Ecology & Environment (12)
- Essays (32)
- Events (25)
- Gourmet (30)
- Info & Biz Technology (290)
- Linux & Open Source (103)
- Linux Journal Index (14)
- Mobility (20)
- Multimedia (17)
- OpenDocument Format (64)
- Web 2.0 (68)
- Linux & Open Source (103)
- Metaphysics (32)
- Misc (8)
- Music & Podcasts (39)
- Podcast: brazilian jazz (8)
- Podcast: general (13)
- Travels (67)
- Central Asia 2007 (29)
- Vegetarianism (10)
Short updates
System Rescue Without a Password
2
comments
By AviPublished:
Wed, 23 Aug 2006 10:44:00 +0000
Updated:
Sun, 28 Dec 2008 11:31:49 +0000
Published:
23 Aug 2006
Updated:
28 Dec 2008
Published:
10:44 am
Updated:
11:31 am
Categories: Linux & Open Source
Tags: best best:tech lang:en tech:yes
So you lost your Linux root password.
No panic. There is a way to reset it:
- Turn the computer on and pay attention.
- When the bootloader (GRUB or LiLo) screen appears, select the partition you want to fix the password.
- Do not boot it yet. Go into edit mode for this partition.
- In the end of the kernel boot parameters line, include this init=/bin/bash.
- Then boot the partition.
- You will see a very fast boot. And right after the pure kernel initialization you’ll receive a root command line. If you try to change a password at this time (with the passwd command), you’ll get a message that means you don’t have write permissions on the filesystem.
- So you’ll have to put your system in a read-write state whit this commands:
bash# mount /proc bash# mount -o remount,rw /
- All set. Now use the passwd command to change the root password.
- Now type the following: sync; sync; exit. Then reset the system.
Note: If the computer has a BIOS or Bootloader password that you don’t know, you won’t be able to use this technique.
The idea here is to change the default program that is executed to setup all the OS environment, right after the kernel initialization. By default it is /sbin/init, and what we did above is to change it to /bin/bash — a regular shell prompt, a command line.