[plug] Query about passwords

Tomasz Grzegurzko tomasz89 at gmail.com
Fri Jan 25 07:23:04 WST 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20080125/db08c49f/attachment.html>


More information about the plug mailing list