[plug] Query about passwords

Tomasz Grzegurzko tomasz89 at gmail.com
Fri Jan 25 09:42:34 WST 2008


On Jan 25, 2008 7:51 AM, Richard Meyer <meyerri at westnet.com.au> wrote:

> On Fri, 2008-01-25 at 07:23 +0900, Tomasz Grzegurzko wrote:
> > On Jan 25, 2008 2:34 AM, Bret Busby <bret at busby.net> wrote:
> >
> >         Hello.
> >
> >         Some time ago, I changed the root password on my laptop, when
> >         I took the
> >         computer to a workshop, to get some problems fixed.
> >
> >         I have since, not been able to remember the root password, and
> >         cannot
> >         log in as root, to do necessary system maintenance.
> >
> >         So, I cannot do things like FTP across our LAN, as /etc/hosts
> >         does not
> >         include most of the nodes, and I cannot update /etc/hosts.
> >
> >         Is it possible to somehow access the previous root password
> >         that I used?
> >         That one, I remember.
> >
> >         Or, do I need to rebuild the system; reinstall it all over
> >         again?
> >
> >         If I have to reinstall it all over again, as the computer dual
> >         boots
> >         with MS Windows XP, can I reinstall the Linux, only, or would
> >         I need to
> >         reinstall Linux, and then reinstall Windows XP?
> >
> >         The Linux is Debian stable (etch ?), having upgraded (?) from
> >         sarge (not
> >         a clean install of Debian 4.0, but an upgrade from 3.1 to
> >         4.0).
> >
> >         Thanks in anticipation.
> >
> >         --
> >         Bret Busby
> >         Armadale
> >         West Australia
> >         ..............
> >
> >
> > Hi,
> >
> > There's more than a couple of ways in. If you have an account which
> > has sudo access, then you need only to
> > # sudo passwd
> >
> > Enter your password, then a new root password twice.
> >
> > If you do not have such an account, you need to find yourself some
> > kind of Linux installatino or live CD. Boot off that. Once you can
> > drop to a console, find which partition your root filesystem is
> > located in, and mount it somewhere. Finally, chroot in to that target
> > and reset the root password. Here's an example:
> > # cat /proc/partitions
> > <to help you locate where your root partition is. Alternatively, edit
> > the boot up grub menu and check the root= parameter from the kernel
> > boot flags.>
> > # mkdir /target
> > # mount /dev/sda1 /target
> > # chroot /target /bin/bash
> > # passwd
> > <enter the new root password twice>
> > # exit
> > # umount /target
> >
> > Reboot the computer, boot back in to Linux, and you're done.
> >
> >
> >
> > Hope that helps.
> >
> > Tomasz
>
> When booting you could try giving it the extra parameter "init=S" (IIRC)
> (to start in single user mode) and then enter "passwd" and enter the new
> password, then "init 5" (or whatever Debian wants) and you should be up
> in multi-user mode.
>
> HTH
>

Ahh that's a nice way too of course; since you can boot your system okay,
you can just append to the kernel boot params:
init=/bin/bash
you'll get a prompt so you can change the root password. Once you're done,
# exec /sbin/init

(Told you there were more than a few ways ;)

Tomasz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20080125/a4922079/attachment.html>


More information about the plug mailing list