[Discuss] Forgotten users and passwords in Debian
Arthur Ralfs
acralfs at shaw.ca
Tue Jul 3 13:54:00 PDT 2007
Alan W. Irwin wrote:
> On 2007-07-02 20:42-0700 Murray Strome wrote:
>
>> I have an old computer on which I installed Debian some time ago
>> (this was in order to get the library software, Koha, to work). I
>> have not looked at that computer for many months, and now realize
>> that I have completely forgotten all the user names and passwords and
>> the root password. Without having to install everything (it took
>> days to get it working the first time because Koha installation is so
>> complicated), I really don't want to try that. I tried booting in
>> Rescue mode, but it wants the root password which I don't remember.
>>
>> Even if I could get to the list of users, presumably in /etc, it
>> might twig my memory about one or more of the user passwords.
>>
>> Any ideas?
>
> This is what rescue distros such as tomsrtbt (http://www.toms.net/rb/) or
> RIP (http://www.tux.org/pub/people/kent-robotti/looplinux/rip/) are
> for. I
> think you can use Knoppix for rescue as well. When you boot a rescue
> distro
> you ordinarily end up with a working Linux distro in RAM with lots of
> useful
> rescue applications such as mount which can be used to mount the disk
> partition that includes /etc. You can then edit /etc/shadow to
> completely
> remove the password (empty the second colon-delimited field so the
> first few
> letters are "root::"). You should then be able to boot your Ubuntu
> system
> as root with no password and then establish passwords for all your
> different
> accounts (including root).
>
> Alan
After booting up the rescue system you can also use the chroot command.
This command changes the root of the file system and then executes another
command which in your case could be bash. You can then use passwd to
reset the root password or do anything else you like as root.
Arthur Ralfs
More information about the Discuss
mailing list