[CentOS] OT: Torrent software choice

Tue Feb 23 08:03:32 UTC 2010
Niki Kovacs <contact at kikinovak.net>

John R Pierce a écrit :
> 
> in a nutshell, you boot the linux CD into 'linux rescue mode', then the 
> usernames are in the /etc/passwd file on the mounted hard drive, which 
> is I believe mounted as /a, so it would be /a/etc/passwd, and the 
> passwords themselves are encrypted in /etc/shadow  ...  its easiest to 
> edit /etc/shadow (probably as /a/etc/shadow due to the rescue mount), 
> then just zap out the password field.
> 

You can even do it without the CD.

At the GRUB command line, add this to the kernel= line :

init=/bin/bash

This gets you to a bash prompt without asking for a password. From 
there, you mount the root partition in r/w mode :

# mount -o remount,rw /

Now you can reset your password :

# passwd

Since the system wasn't booted in a very orthodox way, we have to shut 
it down a bit differently.

# mount -o remount,ro /

Now simply press the power button to switch the machine off.