Reset of master password

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
52ROSt
Level 5
Level 5
Posts: 786
Joined: Mon Apr 14, 2014 10:01 am

Reset of master password

Post by 52ROSt »

LM 20.2 Cinnamon

I needed to have the motherboard replaced. For having this done, the master password was changed, but not be me.

Now don't laugh!

The "changer" of the master password forgot the new password and the changer of the motherboard forgot it as well.

Is there a chance to reset the current master password without reinstalling LM completely new? (The PC is tweaked a lot!)

Thanks for helping replies.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 30112
Joined: Wed Jul 06, 2011 3:58 am

Re: Reset of master password

Post by xenopeek »

Depends on what you mean with "master password". Do you mean:
1. the password of your primary Linux Mint account, the one with administrator privileges
2. the root account (username: root), which is not enabled normally on Linux Mint
3. the disk encryption mount passphrase that you need to enter before Linux Mint boots
4. or perhaps BIOS password?
Image
User avatar
52ROSt
Level 5
Level 5
Posts: 786
Joined: Mon Apr 14, 2014 10:01 am

Re: Reset of master password

Post by 52ROSt »

@ xenopeek

Thanks for reply and detailed questions.

It is the password of my primary Linux Mint account, the one with administrator privileges.
User avatar
xenopeek
Level 25
Level 25
Posts: 30112
Joined: Wed Jul 06, 2011 3:58 am

Re: Reset of master password

Post by xenopeek »

Okay. The below can be used to reset your password, but only if you weren't using any type of disk encryption. If you used full disk encryption or home directory encryption there are more steps to this.

But assuming no disk encryption these are the steps. Power on the computer and hold down or repeatedly press the down arrow key to force the GRUB boot menu to show. Here select to boot recovery mode (I think in advanced boot options). Then select to drop to a root console. If this prompts you for a password, that needs root's password. If it doesn't prompt you for a password or you knew root's password, you'll end up on a full screen terminal (command line interface). Here enter these two commands:

Code: Select all

mount -o remount,rw /
ls /home
The first makes the system writable. It boots in read-only mode by default so this is needed. The second command will show all the usernames on your system. Next run these three commands and replace "username" in the first command with the username as shown in the ls /home output for which you want to reset the password. It's case sensitive so type it exactly as shown in ls /home output.

Code: Select all

passwd username
sync
reboot
The first command will prompt you to enter a new password for the username. The second and third ensure it's written to disk and then reboots the system.
Image
User avatar
all41
Level 19
Level 19
Posts: 9892
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Reset of master password

Post by all41 »

Innocuous way--create a new user with root privilege
Follow steps 1 thru 4 here to get to a command line:
https://linuxconfig.org/ubuntu-20-04-re ... t-password
that will display a command prompt.
Then:
1. Add a user named 'me' (can be any name)

Code: Select all

 useradd me

enter
2. Set the password for 'me'

Code: Select all

 passwd me
(can be any password)
enter and verify
3. Make a home directory for 'me'

Code: Select all

mkdir /home/me
enter
4. Take ownership of that directory

Code: Select all

chown me /home/me
enter
5. Set the group for 'me'

Code: Select all

chgrp me /home/me
enter
6. Give user 'me' sudo privilege

Code: Select all

usermod -aG sudo me
enter
7. reboot

Code: Select all

reboot -f
enter

finished--now login as 'me'--password 'me'
'me' user can invoke full root privilege (sudoer)

Use this to enter Users and Groups and make changes there to restore normal login
and/or make other needed changes--
You can delete the 'me' user afterward.
Everything in life was difficult before it became easy.
User avatar
xenopeek
Level 25
Level 25
Posts: 30112
Joined: Wed Jul 06, 2011 3:58 am

Re: Reset of master password

Post by xenopeek »

all41 wrote: Fri May 20, 2022 12:41 pm Then:
1. Add a user named 'me' (can be any name)

Code: Select all

 useradd me

enter
2. Set the password for 'me'

Code: Select all

 passwd me
(can be any password)
enter and verify
3. Make a home directory for 'me'

Code: Select all

mkdir /home/me
enter
4. Take ownership of that directory

Code: Select all

chown me /home/me
enter
5. Set the group for 'me'

Code: Select all

chgrp me /home/me
enter
Steps 1 through 5 can be replaced by a single adduser me.
Image
User avatar
all41
Level 19
Level 19
Posts: 9892
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Reset of master password

Post by all41 »

WOW--that users gets sudo?
Everything in life was difficult before it became easy.
User avatar
xenopeek
Level 25
Level 25
Posts: 30112
Joined: Wed Jul 06, 2011 3:58 am

Re: Reset of master password

Post by xenopeek »

all41 wrote: Fri May 20, 2022 12:57 pm WOW--that users gets sudo?
No, you still need your step 6 for that. But the adduser command does the same thing as all your lower level commands from your step 1 through 5.
Image
User avatar
all41
Level 19
Level 19
Posts: 9892
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Reset of master password

Post by all41 »

xenopeek wrote: Fri May 20, 2022 1:06 pm
all41 wrote: Fri May 20, 2022 12:57 pm WOW--that users gets sudo?
No, you still need your step 6 for that. But the adduser command does the same thing as all your lower level commands from your step 1 through 5.
Got it.
Less typing=less odds of pebkac-- 8)
Thanks
Everything in life was difficult before it became easy.
User avatar
all41
Level 19
Level 19
Posts: 9892
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Reset of master password

Post by all41 »

The opening quote from this link: https://linuxhandbook.com/useradd-vs-adduser/ is enlightening:
Useradd is built-in Linux command that can be found on any Linux system. However, creating new users with this low-level is a tedious task because it doesn't create home directory and user password by default.

Adduser is not a standard Linux command. It’s essentially a Perl script that uses the useradd command in the background. This high-level utility is more efficient in properly creating new users on Linux. It gives you the option to create home directory, set password along with a few more parameters.
Digesting
Everything in life was difficult before it became easy.
Locked

Return to “Beginner Questions”