[SOLVED] Reset Root Password

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

[SOLVED] Reset Root Password

Postby Kadmus » Nov 13th, '13, 22:31

Unexpectedly my root password is not accepted. I disccovered this when I tried to log into MCC and it did not accept my password. I checked to see if the NumLock was off, it was not so I entered the password again. Rejected. I opened a terminal an typed; su then Énter´ I typed my password an it came up with; su: Authentication failure. That was what I saw when attempting to login in to Mageia Control Center. I attempted a change but the method was not for the Root. I will continue searching but am hopign some one here can lend me hand?

Kadmus
Last edited by doktor5000 on Feb 10th, '15, 22:31, edited 1 time in total.
Reason: marked thread [SOLVED]
Kadmus
 
Posts: 40
Joined: Nov 11th, '13, 22:37

Re: Reset Root Password

Postby doktor5000 » Nov 13th, '13, 23:13

In bootloader press F6 then select -> Default and then append init=/bin/sh and it should boot to a command prompt. Set a new root password there by entering
Code: Select all
passwd
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Reset Root Password

Postby duncangareth » Aug 1st, '14, 13:02

This is extremely helpful when one's assistant (who is new to Mageia) forgets his root password. It overcomes the issue whereby one cannot reset the root passwd using the old Mandrake/Mandriva rescue boot chroot method.

Thanks.
duncangareth
 
Posts: 66
Joined: Oct 24th, '13, 21:05

[SOLVED] administrator password forgotten

Postby carov » Feb 6th, '15, 22:59

Hi!
I totally forgot the administrator authentication password and now I am not able to install anything. Is there anything I can do to recover or change that password??

thanks :)
Last edited by carov on Feb 9th, '15, 23:44, edited 1 time in total.
carov
 
Posts: 4
Joined: Feb 6th, '15, 22:45

Re: administrator password forgotten

Postby benmc » Feb 7th, '15, 05:20

Hi

If you still have your install media or if you can make a new one, you can fake the install and enter new passwords- it will take about 5-10 minutes and you wont loose any data if you are careful.
golden rule: backup any personal data first..

this doesnt work with live media, only the classical install media.
this not an upgrade, so where it asks to upgrade Mageia or install, choose install.

boot to your install media and choose: Install Mageia 3/4/cauldron.
choose language, accept license, choose keyboard and choose custom disk partitioning.
choose the correct hard-disk if you have more than one, click on partitions one at a time, and from the dropdown menu choose / , /home, etc as required.
it is important to make sure that they are the same ones from your original install. do you remember which is which?
the next screen will have some check boxes for formatting the partitions.
make sure they are all unchecked.
then choose your usual desktop,
the next step, the actual install should, should only take about a minute or 2, as nothing is being installed, then,
at the set up users / password screen , enter a new admin password, your old user name and existing password.
at the configuration screen, set up location, bootloader, network etc as you did last time,
accept and reboot

that should take you back to your desktop with root password that will work.
you will have to reset you online media repos

regards

Ben
benmc
 
Posts: 1175
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: administrator password forgotten

Postby doktor5000 » Feb 7th, '15, 12:49

FWIW, a repair-install isn't required. At the bootloader, simply add init=/bin/sh to the kernel command line after pressing F3 and selecting Default, and at the prompt change the root password via passwd command.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: administrator password forgotten

Postby benmc » Feb 7th, '15, 23:06

thanks for that useful tip, Doktor5000
benmc
 
Posts: 1175
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: administrator password forgotten

Postby doktor5000 » Feb 7th, '15, 23:34

You're welcome. That's how this is working for ages on all linux distros.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: administrator password forgotten

Postby morgano » Feb 8th, '15, 02:33

Yes I am happy i encrypt my data...

Just wondering: Is there a simple way to disable the "add init=/bin/sh to the kernel command line" trick?
Mandriva since 2006, Mageia 2011 at home & work. Thinkpad T40, T43, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1306
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: administrator password forgotten

Postby doktor5000 » Feb 8th, '15, 20:26

morgano wrote:Just wondering: Is there a simple way to disable the "add init=/bin/sh to the kernel command line" trick?

Yes, use a bootloader password.
See e.g. http://cromwell-intl.com/linux/linux-br ... howto.html
and also
http://unix.stackexchange.com/questions ... t-bin-bash
https://www.ibm.com/developerworks/comm ... x1?lang=en
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: administrator password forgotten

Postby morgano » Feb 9th, '15, 13:00

Thanks
Mandriva since 2006, Mageia 2011 at home & work. Thinkpad T40, T43, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1306
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: administrator password forgotten

Postby carov » Feb 9th, '15, 19:27

Thank you all for your answers

doktor5000 wrote:FWIW, a repair-install isn't required. At the bootloader, simply add init=/bin/sh to the kernel command line after pressing F3 and selecting Default, and at the prompt change the root password via passwd command.


Doktor5000, I dont have any experience with linux, can you please tell me how do I get to the bootloader?
thanks!
carov
 
Posts: 4
Joined: Feb 6th, '15, 22:45

Re: administrator password forgotten

Postby doktor5000 » Feb 9th, '15, 20:12

Simply reboot. Before Mageia loads, you will see a similar screen to this:
Bildschirmfoto2_133.png
Bildschirmfoto2_133.png (192.62 KiB) Viewed 21292 times


That is the (default) bootloader, called grub legacy. In there press F3 then select -> Default and then append init=/bin/sh in the input line that appears.
(Be aware that you may have english keyboard layout there. For that, the = sign is on the ´ key and / is on the - key.)

This is what it should look like then:
Bildschirmfoto2_134.png
Bildschirmfoto2_134.png (193.38 KiB) Viewed 21292 times
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: administrator password forgotten

Postby carov » Feb 9th, '15, 20:31

Thank you very much! :)
carov
 
Posts: 4
Joined: Feb 6th, '15, 22:45

Re: administrator password forgotten

Postby doktor5000 » Feb 9th, '15, 20:42

Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks

edit doktor5000: merged into existing thread, move to tips&tricks subforum and changed to sticky thread.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] Reset Root Password

Postby lordshipmayhem » Apr 14th, '15, 12:03

I've been doing all of that, and am now quite familiar with the procedure - but I'm getting "cannot set terminal process group (-1): Inappropriate ioctl for device no job control in this shell" error.

Also I found recommendations elsewhere recommending removal of "quiet" and "splash" if they're present. Is that necessary as well?
http://linuxconfig.org/recover-reset-fo ... t-password
lordshipmayhem
 
Posts: 7
Joined: Jul 25th, '13, 19:22

Re: [SOLVED] Reset Root Password

Postby doktor5000 » Apr 14th, '15, 20:35

You did all of what, and you get the error message you listed when doing what in particular?

quite and splash bootoptions are totally irrelevant and can be left as they are.

The error message you get may result from wrong usage of su, see first answer at
http://serverfault.com/questions/411307 ... ogin-shell
or maybe http://unix.stackexchange.com/questions ... ge-from-su
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] Reset Root Password

Postby fossiili » Sep 13th, '15, 11:08

Thank you! Even I could use this F3-trick :mrgreen:

I could restore the administrative password. But my problem in that terminal was: how to proceed? The result of "exit" was that the computer froze. I had to switch the electricity off :roll:
User avatar
fossiili
 
Posts: 16
Joined: Oct 31st, '11, 17:40

Re: [SOLVED] Reset Root Password

Postby doktor5000 » Sep 13th, '15, 14:13

Either one of
Code: Select all
reboot
or
Code: Select all
shutdown -Fr now
or
Code: Select all
init 6
to reboot. Even Ctrl+Alt+Del should have worked.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] Reset Root Password

Postby plspls » Aug 16th, '16, 14:21

very important tips if you reset root password:
never lose password or you lose access to the computer and have to reinstall completely to get access again of course all data is lost
select a password difficult to guess or hackers will access your computer
plspls
 
Posts: 95
Joined: Aug 14th, '16, 11:38

Re: [SOLVED] Reset Root Password

Postby doktor5000 » Aug 16th, '16, 20:03

plspls wrote:never lose password or you lose access to the computer and have to reinstall completely to get access again of course all data is lost

That comment .. in a thread which explains how to reset/recover a password ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] Reset Root Password

Postby morgano » Aug 17th, '16, 09:20

Pretty amusing :)

And even if root password is forgotten, user can normally log in as usual and retrieve their data.
If system is unbootable the computer can boot on an USB or CD/DVD ("live" or "repair" system), or move disk to other system for accessing data.

What one really should be careful with is any data encryption keys

And yes i forgot root password on an old spare laptop i did not use for over a year - i just reinstalled the system with later mageia, new root password, reused home but with newly created user for same data. Done.
Mandriva since 2006, Mageia 2011 at home & work. Thinkpad T40, T43, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1306
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: [SOLVED] Reset Root Password

Postby jiml8 » Aug 22nd, '16, 06:20

What one really should be careful with is any data encryption keys


ALWAYS ALWAYS ALWAYS backup this data!!!

To get all the crypto data:
Code: Select all
sudo cryptsetup luksHeaderBackup --header-backup-file=sdf1 /dev/sdf1

where you specify the drive you want to back up (this example backs up sdf1 crypto data)

To restore all the crypto data:
Code: Select all
cryptsetup luksHeaderRestore --header-backup-file=sdf1 /dev/sdf1


I am not sure whether or not the crypto data includes the metadata, so I back that up separately:
Code: Select all
cryptsetup luksDump <your luks dev>

search for a line
Payload offset: <payloadnumber>

Now to backup your metadata - that is everything before the payload - run
dd if=<your luks dev> of=<destination, see below> bs=<payloadnumber> count=1

To restore the metadata, reverse "of=" and "if=" in the command above.


I have had to restore the crypto data on one disk, one time. But, that one time, I was really glad I had the backup.
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: [SOLVED] Reset Root Password

Postby doktor5000 » Aug 22nd, '16, 19:00

Backup and restore is also covered pretty well in cryptsetup FAQ: https://gitlab.com/cryptsetup/cryptsetu ... dQuestions in section 6.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17627
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] Reset Root Password

Postby inktvis75 » Oct 9th, '17, 11:30

The reset password procedure as described in this document,
is maybe still working, but there is a better way to do it.
--> https://wiki.mageia.org/en/Rescue
inktvis75
 
Posts: 8
Joined: Jun 21st, '13, 08:42
Location: The Netherlands

Next

Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 0 guests

cron