Archive of the day May 29, 2008

Mom, I forgot the root password!

Nessun commento » Debian , Shell , System , Tips & Tricks No Comments »

RTFM for the series, reported below are the instructions given in Italian official documentation on Debian to recover the root password. I do it for the consumption of a very lazy person who asked me.

8.1.1 "I forgot the root password!" (1)

And 'possible to boot the system and access to the root account, even if you do not know your password, simply having access to the keyboard. (This assumes there are no password requests from the BIOS or the boot loader such as lilo that would prevent access to the system).

This procedure requires no external boot disks and no change in BIOS. In this context, "Linux" is the label for booting the kernel in a Debian install.

At the lilo boot screen, as soon as boot: appears (in some systems, you must press the shift key to prevent automatic booting) and when lilo uses the framebuffer you press TAB to see the options you type), enter:

boot: Linux init=/bin/sh

The system boots the kernel and run / bin / sh instead of its standard init. At this point you have gained root privileges and a root shell. Since / is mounted read-only and many disk partitions have not been mounted yet, you must do the following to have a reasonably functioning system.

init-2.03# mount -n -o remount,rw /
init-2.03# mount -avt nonfs,noproc,nosmbfs
init-2.03# cd /etc
init-2.03# vi passwd
init-2.03# vi shadow

(If the second data field within the / etc / passwd is "x" for every username, your system uses shadow passwords, you must edit / etc / shadow.) To disable the root password, edit the second field in the password file so that it is empty. Now you can reboot and log in as root without a password. When booting into runlevel 1, Debian (at least after Potato) requires a password, which some older distributions did not.

It 's good to have a minimal editor in / bin if / usr is not accessible (see Rescue editors, Section 11.2).

Also consider installing the sash package. If the system becomes unbootable, execute:

boot: Linux init=/bin/sash

sash serves as an interactive substitute for sh even when / bin / sh is unusable. It's statically linked, and includes many standard utilities as built-ins (type "help" at the prompt for a reference list).

8.1.2 "I forgot the root password!" (2)

Boot from any emergency boot disk set / root. If, for example, / dev/hda3 is the original root partition, the following will let one edit the password file as easily as above.

# mkdir fixit
# mount /dev/hda3 fixit
# cd fixit/etc
# vi shadow
# vi passwd

The advantage of this approach over the previous method is that it requires knowledge of the lilo password (if any). However, one must be able to set the BIOS, if not already, so the system to boot from floppy or CD.

Source: http://www.debian.org/doc/manuals/reference/ch-tips.it.html

Farm Preggio

4 commenti » Logbook 4 Comments »

If you - like me - those who do not like to plan their holidays and have not booked anything, take a look at this new farmhouse in the peaceful hills of Umbria.

Here is a brief presentation of the structure:

Seventy acres of tranquility. This is probably the best description we can give our farm. No noise, no traffic, no view on the E45 (the only way you'll see is the one to arrive here), no buildings nearby, no GMO fields, nothing ....! A wide valley straddling a stream dotted with woods, olive groves, pastures and crops organically. On the opposite side a shepherd looks after his sheep, and in the valley in the distance, a herd of Chianina peeps. And the night has its charms: Castel Rigone lights in the distance, a few scattered huts with only the courtesy lamp for travelers and the stars above your head, here in Preggio you can really see why they call it "the Milky Way "(How long is that you no longer see it?). If we want to turn off all our lights for you to observe it better.

In the whole Borough, including Farm and then, applies a polite but firm "No Smoking". Nothing personal, we are aware that there are things far more harmful smoke, but the point is that the smell of smoke in the rooms, remains. And the cigarette butts scattered on the lawn around the pool, remain. And both, smells and cigarette butts, remain for much longer than you think. So please look before you book, that if you smoke is an irresistible pleasure perhaps we are not the place for you.

Of course the farm alongside our farm where we produce wine, oil, cheese, honey ...

For more information: http://www.preggio.it