FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-24-2008, 07:30 PM
Grant
 
Default Recovering root password

I've revived an old Gentoo laptop, but I've forgotten the root
password. I remember the password to my user account and I can log in
there fine. Can I recover the root password?

- Grant
--
gentoo-user@lists.gentoo.org mailing list
 
Old 03-24-2008, 07:34 PM
"Boris Fersing"
 
Default Recovering root password

On Mon, Mar 24, 2008 at 4:30 PM, Grant <emailgrant@gmail.com> wrote:
> I've revived an old Gentoo laptop, but I've forgotten the root
> password. I remember the password to my user account and I can log in
> there fine. Can I recover the root password?
>
> - Grant

Hi,

boot with a liveCD, mount the gentoo partition, chroot into it and type 'passwd'

regards,

Boris.
> --
> gentoo-user@lists.gentoo.org mailing list
>
>



--
$ ruby -e'puts " .:@BFegiklnorst".unpack("x4ax7aaX6ax5aX15ax4aax6aa X7ax2
aX5aX8axaX3ax8aX4ax6aX3aX6ax3ax3aX9ax4ax2aX9axaX6a x3aX2ax4
ax3aX4aXaX12ax10aaX7a").join'
--
gentoo-user@lists.gentoo.org mailing list
 
Old 03-24-2008, 07:39 PM
Dale
 
Default Recovering root password

Grant wrote:

I've revived an old Gentoo laptop, but I've forgotten the root
password. I remember the password to my user account and I can log in
there fine. Can I recover the root password?

- Grant



I think you can boot into single user mode and reset it. You have to
put it on the end of the grub boot line but I can't recall what the
exact option is. May help you search tho.

You can also boot the CD and chroot in to reset it as well. I'm sure
that will work just as well.


Dale

:-) :-)
--

gentoo-user@lists.gentoo.org mailing list
 
Old 03-24-2008, 07:40 PM
"Ricardo Saffi Marques"
 
Default Recovering root password

On Mon, Mar 24, 2008 at 5:30 PM, Grant <emailgrant@gmail.com> wrote:

I've revived an old Gentoo laptop, but I've forgotten the root

password. *I remember the password to my user account and I can log in

there fine. *Can I recover the root password?
On the grub menu, edit the entry of the system you want to boot and on the kernel line, add "init=/bin/bash" without the quotes. Boot that modded boot instructions sequence. After kernel loads, you'll have a bash. Type: "mount -o rw,remount /"

Then type "passwd", put the new root pwd. Remount the partition read-only: "mount -o ro,remount /" and reboot. Done!

--
Ricardo Saffi Marques
Laboratório de Administração e Segurança de Sistemas (LAS/IC)

Universidade Estadual de Campinas (UNICAMP)
Cell: +55 (19) 8128-0435
Skype: ricardo_saffi_marques
Website: http://www.rsaffi.com
 
Old 03-24-2008, 07:42 PM
Alan McKinnon
 
Default Recovering root password

On Monday 24 March 2008, Grant wrote:
> I've revived an old Gentoo laptop, but I've forgotten the root
> password. I remember the password to my user account and I can log
> in there fine. Can I recover the root password?

No, that would require undoing high-quality encryption schemes. Which is
a good thing, otherwise your internet banking couldn't be safe (amongst
other similar evils)

What you can do is replace the root password with something else:

Boot from any old LiveCD, mount your gentoo partitions somewhere, chroot
into them as root and run 'passwd'

If this sounds familiar, it's because it's the same process you used to
install Gentoo in the first place :-)


--
Alan McKinnon
alan dot mckinnon at gmail dot com

--
gentoo-user@lists.gentoo.org mailing list
 
Old 03-24-2008, 07:45 PM
Steven Lembark
 
Default Recovering root password

> On the grub menu, edit the entry of the system you want to boot and on the
> kernel line, add "init=/bin/bash" without the quotes. Boot that modded boot
> instructions sequence. After kernel loads, you'll have a bash. Type: "mount
> -o rw,remount /"

Make sure that your bash is statically linked,
otherwise you can run into problems with this
approach. It's acutally a good idea to keep
a static bash and just put this into grub as
the 'shell-init' or 'aaaargh' entry
(it's in their example config).




--
Steven Lembark +1 888 359 3508
Workhorse Computing 85-09 90th St
lembark@wrkhors.com Woodhaven, NY 11421
--
gentoo-user@lists.gentoo.org mailing list
 
Old 03-24-2008, 07:49 PM
Florian Philipp
 
Default Recovering root password

On Mon, 2008-03-24 at 15:39 -0500, Dale wrote:
> Grant wrote:
> > I've revived an old Gentoo laptop, but I've forgotten the root
> > password. I remember the password to my user account and I can log in
> > there fine. Can I recover the root password?
> >
> > - Grant
> >
>
> I think you can boot into single user mode and reset it. You have to
> put it on the end of the grub boot line but I can't recall what the
> exact option is. May help you search tho.
>
> You can also boot the CD and chroot in to reset it as well. I'm sure
> that will work just as well.
>
> Dale
>
> :-) :-)

The option is "single" but it won't help because it requests the root
password before it gives you your /bin/bash.

Anyway, if you have sudo-rights, you can simply do "sudo passwd" and it
won't ask you for the old password.
 
Old 03-24-2008, 07:49 PM
"Ricardo Saffi Marques"
 
Default Recovering root password

On Mon, Mar 24, 2008 at 5:45 PM, Steven Lembark <lembark@wrkhors.com> wrote:

It's acutally a good idea to keep a static bash and just put this into grub as the 'shell-init' or 'aaaargh' entry (it's in their example config).
That's what I do, at least.
I have that boot entry for cases like that (or worse :-))

--
Ricardo Saffi Marques
Laboratório de Administração e Segurança de Sistemas (LAS/IC)
Universidade Estadual de Campinas (UNICAMP)
Cell: +55 (19) 8128-0435

Skype: ricardo_saffi_marques
Website: http://www.rsaffi.com
 
Old 03-24-2008, 08:57 PM
Neil Bothwick
 
Default Recovering root password

On Mon, 24 Mar 2008 17:40:13 -0300, Ricardo Saffi Marques wrote:

> On the grub menu, edit the entry of the system you want to boot and on
> the kernel line, add "init=/bin/bash" without the quotes. Boot that
> modded boot instructions sequence. After kernel loads, you'll have a
> bash. Type: "mount -o rw,remount /"

Or just add "rw init=/bin/sh" to avoid remounting /.

It's probably better to use a shell designed for rescue work,
like sash or busybox instead of bash, especially if /usr is on a
separate filesystem.


--
Neil Bothwick

"We are Microsoft of Borg. Prepare to...."
The application "assimilation" has caused a General Protection Fault
and must exit immediately.
 
Old 03-24-2008, 10:52 PM
Steven Lembark
 
Default Recovering root password

> It's probably better to use a shell designed for rescue work,
> like sash or busybox instead of bash, especially if /usr is on a
> separate filesystem.

The statically linked bash acutally works rather
well for this. The main advantage I've found
using it for recovery situations is that I'm
used to it: sourceing root's .bash_profile is
enough to give a familiar environment.

--
Steven Lembark +1 888 359 3508
Workhorse Computing 85-09 90th St
lembark@wrkhors.com Woodhaven, NY 11421
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 03:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org