Gentoo Archives: gentoo-user

From: Tamer Higazi <th982a@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Resetting the root passwd
Date: Wed, 11 Jan 2012 22:09:13
Message-Id: 4F0E053B.1020605@googlemail.com
In Reply to: [gentoo-user] Resetting the root passwd by Tanstaafl
1 I tell you the right way todo it. Make it easy as possible, not so
2 difficult like the others in the thread!
3
4 Download system rescuecd (which is a nice gentoo system with lots of
5 beautiful tools running out of the box):
6
7 http://www.sysresccd.org/Download
8
9
10 download, burn and boot from the cd. This is a gentoo live cd, with
11 maintenance tools!
12
13
14 After you started from the cd, create a directotry, let us say: /mnt/gentooX
15
16 and mount your partition inside, where the entire tree lives in it.
17
18 if /dev/sda5 or whatever has the entire tree:
19
20 mount /dev/sda5 /mnt/gentooX
21
22 optionally mount the other partitions from your harddisk, if "opt" is in
23 your harddisk an own partition, otherwise look in your harddisk, in this
24 case:
25
26 /mnt/gentooX/etc/fstab
27
28 which shows you the partition table!
29
30 chroot the new environment:
31
32 mount -t proc none /mnt/gentoo/proc
33
34 if you need networking, otherwise leave this step away.
35 cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
36
37
38 chroot /mnt/gentoo /bin/bash
39 env-update
40 source /etc/profile
41
42
43 after you did this, your are on your harddisks environment as root, and
44 you easily can issue this command:
45
46 passwd root
47
48
49 Tamer
50
51 Am 10.01.2012 19:46, schrieb Tanstaafl:
52 > Ok, I did something really dumb...
53 >
54 > I changed the root passwd for a system I manage last week, but neglected
55 > to write it down, and now what I *thought* I had changed it to isn't
56 > working... I know, I know, really *really* dumb, but that's where I am...
57 >
58 > I know I can boot into Single User mode, remount the root partition
59 > read/write, and edit /etc/shadow (removing the encrypted passwd), then
60 > rest it using passwd, but...
61 >
62 > Some of the accounts in /etc/shadow have a '*' where the encrypted
63 > passwd would be, and some have a '!'... (ie, one is sshd:!:... and
64 > another is halt:*:...)
65 >
66 > Does it matter what I change it to? Should I use a *, !, or nothing at
67 > all (so that there is *nothing* between the two :: that would normally
68 > contain the encrypted passwd)?
69 >
70 > Thanks...
71 >