Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Forgotten root password in Mandrake 10.1

0 views
Skip to first unread message

A.nt...@gmx.net

unread,
Sep 28, 2005, 8:14:13 AM9/28/05
to
Hallo!
I need help, I haven't used Linux for a couple of months (no much
experience with it anyway) and have now lost / forgotten my root
password. Is there any way to change it? I usually boot with GRUB,
installed on a floppy.
Thanks in advance for any help!
Antonio Martino

Aresino

unread,
Sep 28, 2005, 8:41:56 AM9/28/05
to
Here is sthg. I found on other postings, some regarding previous
versions of Mandrake and I don't know if they still apply:

1 - if you have physical access to the machine it is not much harder;
boot from a live CD, edit /etc/shadow, reboot

I do have access to my machine, I can even boot into Linux as "normal"
user, but I can't change any settings where root password is needed.
But I do not have any live CD (just installation DVD - by the way, it
is the Mandriva Donwload Edition 2005) - what exactly should one edit?


2 - All you have to do is remove the password, e.g.:
root::12776:0:99999:7:::
Then log in and set a new one ASAP.

Is this some entry or line or whatever it is called in the above
mentioned /etc/shadow?

3 - Have you tried the passwd command?

What is this about?

I hope this are not too much questions at a time.

Bit Twister

unread,
Sep 28, 2005, 9:20:55 AM9/28/05
to
On 28 Sep 2005 05:14:13 -0700, A.nt...@gmx.net wrote:
> Hallo!
> I need help, I haven't used Linux for a couple of months (no much
> experience with it anyway) and have now lost / forgotten my root
> password. Is there any way to change it?

Yes.

> I usually boot with GRUB,
> installed on a floppy.

Using the following url with
reset root passowrd in the first box and asterisk mandrake asterisk
in the newsgroup box I get
Results 1 - 10 of 150 for reset root password group:*mandrake* (0.25
seconds)

adding grub will help zero in on the commands.

Please bookmark the following, very large,
Frequently Asked Questions (faq) Search engine:

http://groups.google.com/advanced_group_search
key word(s) in the first box
*linux* in Newsgroup box. You need to use the two
asterisks around linux, pick English

If you want/need more control over the first box search,
http://www.google.com/help/refinesearch.html

Aresino

unread,
Sep 28, 2005, 9:47:44 AM9/28/05
to
Bit Twister ha scritto:

> Using the following url with
> reset root passowrd in the first box and asterisk mandrake asterisk
> in the newsgroup box I get
> Results 1 - 10 of 150 for reset root password group:*mandrake* (0.25
> seconds)

I got :Risultati 1 - 10 di 148 per reset root password group:*mandrake*
(0,12 secondi) - most of them are very old, do the hints apply to my
version of Linux too?

> adding grub will help zero in on the commands.

None of the 13 results are helpful, and the newest is of the year 2003.

> Please bookmark the following, very large,
> Frequently Asked Questions (faq) Search engine:

I already did search before asking, but the answers I found were or
very old or didn't match with my problem.


>>Is there any way to change it?
>Yes.

If you know how to do, would it be very nice of you if you could help
more directly, instead of relinking me to the Google Search.
Thanks the same,
Antonio Martino

P.S.: the second posting is also mine, I dont know why Google displays
two different authors. As you see I already gave a look around.

Bit Twister

unread,
Sep 28, 2005, 10:21:38 AM9/28/05
to
On 28 Sep 2005 06:47:44 -0700, Aresino wrote:
>
> I got :Risultati 1 - 10 di 148 per reset root password group:*mandrake*
> (0,12 secondi) - most of them are very old, do the hints apply to my
> version of Linux too?

Commands to get into single user mode have not changed.

>
> If you know how to do, would it be very nice of you if you could help
> more directly, instead of relinking me to the Google Search.

You might want to read
http://www.catb.org/~esr/faqs/smart-questions.html


--- standard include single user password text follows: -------------

---------------- using lilo -----------------------

Hit Esc or Tab key at lilo prompt then

linux 1 or linux single

at the system prompt
passwd root
or
passwd user_login_name_here

--------------- using rescue disk/cd -----------------
If using Mandrake:
Using rescue mode on cd 1
Hit F1 key
rescue
mount your partitions under /mnt (down arrows, tab, enter)
enter
Go to console (down arrows, tab, enter)
chroot /mnt
passwd root
or
passwd user_login_name_here

----------------- using grub ----------------------
When at the grub menu

Hit e to get to the edit mode
You should be on the Kernel line containing /vmlinuz
Hit e again and add a
space single
to the end of line and hit Enter key. Example:
kernel (hd0,4)/vmlinuz 1 root=/dev/hda9 mem=128M single
then b to boot

You then come to the sh-nnn# prompt.
passwd root
or
passwd user_login_name_here

When you "exit" the system will continue booting.

If single does not work, try a 1 instead.

---------------------- expired password -------------------

Boot in the box using the failsafe mode or linux single, or linux 1.
cd /etc
cp shadow shadow_backup <--- save a copy for just in case.
vi shadow
i <------- sets insert mode and use arrow keys for navigation
now change fields 4, 5, 6, 7, 8, 9 to look like the following:
root:$1$9f6jMOZn$gCYd2F/zy0Uri.FIfnUh3/:12390:0:99999:7:::
1 2 3 4 5 6789 <---- fields
Esc <--- escape key to get vi's attention
:w <--- writes changes to disk
Esc
:q <--- quit vi


If you think your box has been cracked, look here
http://groups.google.com/advanced_group_search

google_tag_cracked_4_next_time in the first box
alt.os.linux in the Newsgroup box, pick English

Unruh

unread,
Sep 28, 2005, 11:17:59 AM9/28/05
to
"Aresino" <A.nt...@gmx.net> writes:

>Here is sthg. I found on other postings, some regarding previous
>versions of Mandrake and I don't know if they still apply:

The first thing to try is to boot into single user mode. I do not use grub
and do not know how to do it there, but on lilo, you just wait for the boot
prompt at bootup, and enter
linux 1
This will almost certainly bring you up as root in single user mode, from
which you can run
passwd
and change root's password.

The second thing to try is as in this post. The installation CD is your
installation DVD. When the first screen comes up, press F1 for other, and
then type in rescue.
Then mount the partition containing /etc (probably the one labeled /) and
edit the file /etc/shadow as indicated. Use your favourite, nonGui editor.

Unruh

unread,
Sep 28, 2005, 11:19:46 AM9/28/05
to
"Aresino" <A.nt...@gmx.net> writes:

>Bit Twister ha scritto:

>> Using the following url with
>> reset root passowrd in the first box and asterisk mandrake asterisk
>> in the newsgroup box I get
>> Results 1 - 10 of 150 for reset root password group:*mandrake* (0.25
>> seconds)

>I got :Risultati 1 - 10 di 148 per reset root password group:*mandrake*
> (0,12 secondi) - most of them are very old, do the hints apply to my
>version of Linux too?

>> adding grub will help zero in on the commands.

>None of the 13 results are helpful, and the newest is of the year 2003.

>> Please bookmark the following, very large,
>> Frequently Asked Questions (faq) Search engine:

>I already did search before asking, but the answers I found were or
>very old or didn't match with my problem.

The procedures have not changed since about 1990.

ray

unread,
Sep 28, 2005, 3:15:54 PM9/28/05
to

Yes, I can think of three for four.

Aresino

unread,
Sep 28, 2005, 6:47:15 PM9/28/05
to
Could you maybe also tell us?

Aresino

unread,
Sep 28, 2005, 6:51:45 PM9/28/05
to
>----------------- using grub ----------------------
>When at the grub menu
>Hit e to get to the edit mode
>You should be on the Kernel line containing /vmlinuz
>Hit e again and add a
> space single
>to the end of line and hit Enter key. Example:
> kernel (hd0,4)/vmlinuz 1 root=/dev/hda9 mem=128M single
>then b to boot
>You then come to the sh-nnn# prompt.
>passwd root
>or
>passwd user_login_name_here
>
>When you "exit" the system will continue booting.
>
>If single does not work, try a 1 instead.

Thanks a lot, it worked at the first try - with single, in my case.
P.S.: the right version is Mandrake 10.2

Warren Post

unread,
Sep 30, 2005, 1:14:48 PM9/30/05
to
I'm surprised the Wintrolls haven't jumped all over this thread. You know,
the "You need a root password? Wow, Linux really sucks! Windows doesn't
have any security so you don't need a password" sort of thing. Flatfish
must be busy having his meds refilled or something.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/

0 new messages