[plug] Query about passwords

Richard Meyer meyerri at westnet.com.au
Fri Jan 25 07:51:05 WST 2008


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

-- 
Richard Meyer <meyerri at westnet.com.au>
Necessity is the plea for every infringement of human freedom.
It is the argument of tyrants; it is the creed of slaves. 
William Pitt, 1783

Linux Counter user #306629





More information about the plug mailing list