Gentoo Archives: gentoo-user

From: Norbert Kamenicky <noro@××××××.sk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Forgotten root password on remote system
Date: Sun, 28 Aug 2005 13:39:07
Message-Id: 4311BCBA.1090602@xmedia.sk
In Reply to: [gentoo-user] Forgotten root password on remote system by Grant
1 Grant wrote:
2 > I have forgotten the root password of my remote server. Is there any
3 > way to retrieve or reset it?
4
5 This is my way to solve your problem (and a lot of other problems too):
6
7 Ask some guy on remote side do this:
8
9 1. Put Knoppix CD into drive and reboot
10
11 2. answer "knoppix 2" to "boot:" prompt and hit Enter
12 (If prompt doesn't occur, it's probably necessary
13 to change booting order in BIOS.)
14
15 3. when root prompt "#" appears, write these commands:
16
17 # ifconfig eth0 "server's-IP" netmask "proper-netmask"
18
19 # route add default gw "gateway's-IP"
20
21 # passwd
22 put twice this password: word
23
24 # /etc/init.d/sshd start
25
26 ---------------------------------
27 If everything went OK, u have now remote access to the server
28 and u can do anything u like.
29 U can change password, repair broken lilo or grub setup,
30 repair broken filesystem, install gentoo ... etc.
31
32 To change password, follow these steps:
33
34 mv ~/.ssh/known_hosts{,.bak}
35 ssh root@server
36 mkdir /gentoo
37 mount /dev/"root-device" /gentoo
38 chroot /gentoo
39 passwd (now u are changeing server's password)
40 exit (from chroot)
41 init 6; exit (server reboot)
42 mv ~/.ssh/known_hosts{.bak,}
43 Ask remote guy take out Knoppix CD and press "Enter".
44
45 U can adopt this receipt to any other bootable media (CD, DVD, usb key,
46 HDD, etc.) with nearly any live linux on it (Gentoo, Slax ...)
47
48 HTH, noro
49 --
50 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Forgotten root password on remote system "A. Khattri" <ajai@××××.net>