forgot root password

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
howardballinger

forgot root password

Post by howardballinger »

I can't believe I did this! I need to enter my root password to get updates -- my user password doesn't work. I must have set it to something else and I don't remember what, It was only a couple of weeks ago, I'm a new user. Shame on me! I've researched the problem, it looks like I'll have to edit one of the grubs to reset it. How can I do this?

Here's my inxi system info ...

Code: Select all

System:    Host: shafee-Inspiron-15-5578 Kernel: 4.10.0-38-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.6.6 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.3 Sylvia
Machine:   System: Dell (portable) product: Inspiron 15-5578
           Mobo: Dell model: 0395D5 v: A00
           Bios: Dell v: 1.6.1 date: 02/13/2017
CPU:       Dual core Intel Core i7-7500U (-HT-MCP-) cache: 4096 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 11616
           clock speeds: max: 3500 MHz 1: 500 MHz 2: 499 MHz 3: 499 MHz
           4: 499 MHz
Graphics:  Card: Intel Device 5916 bus-ID: 00:02.0
           Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
           Resolution: 1920x1080@60.06hz
           GLX Renderer: Mesa DRI Intel HD Graphics 620 (Kaby Lake GT2)
           GLX Version: 3.0 Mesa 17.2.4 Direct Rendering: Yes
Audio:     Card Intel Device 9d71 driver: snd_hda_intel bus-ID: 00:1f.3
           Sound: Advanced Linux Sound Architecture v: k4.10.0-38-generic
Network:   Card: Intel Wireless 3165 driver: iwlwifi bus-ID: 01:00.0
           IF: wlp1s0 state: up mac: <filter>
Drives:    HDD Total Size: 1000.2GB (3.5% used)
           ID-1: /dev/sda model: ST1000LM035 size: 1000.2GB
Partition: ID-1: / size: 363G used: 26G (8%) fs: ext4 dev: /dev/sda5
           ID-2: swap-1 size: 8.45GB used: 0.00GB (0%) fs: swap dev: /dev/sda6
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 44.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 198 Uptime: 9:38 Memory: 1331.6/7850.8MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
JerryF
Level 16
Level 16
Posts: 6571
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: forgot root password

Post by JerryF »

howardballinger wrote:I can't believe I did this! I need to enter my root password to get updates -- my user password doesn't work. I must have set it to something else and I don't remember what, It was only a couple of weeks ago, I'm a new user. Shame on me! I've researched the problem, it looks like I'll have to edit one of the grubs to reset it. How can I do this?
...
My suggestion is to find out why you can't use your password to get updates. You really shouldn't be running as root to do that.

Check Users and Groups and see if your username is in the 'sudo' group.
User avatar
Fred Barclay
Level 12
Level 12
Posts: 4185
Joined: Sat Sep 13, 2014 11:12 am
Location: USA primarily

Re: forgot root password

Post by Fred Barclay »

Out of curiosity, did you change your user password after installing Mint?
Image
"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy."
- Albert Einstein
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: forgot root password

Post by austin.texas »

If you can't remember your user's password, you can set a new one.
Boot the computer and select your Mint OS in the Grub menu, but do not press ENTER - instead press e (for EDIT).
Arrow down to the line that starts with "linux"
It will look something like this: linux /boot/vmlinuz-3.16.0-38-generic root=UUID=b1bde976-50e2-4c32-a760-17b091b4202f ro quiet splash $vt_handoff
Go to the end of that line. Delete the words "quiet splash $vt_handoff" if that is there, and put: systemd.unit=multi-user.target
Then press F10 to boot. That will boot to a root shell.
Enter: passwd yourusername (whatever your user name is...)
Press Enter. It will request the new password (twice).
Note: when you type your new password, it will not display on the screen (for security reasons).
When complete, press Ctrl+Alt+Delete to reboot.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
Mute Ant

Re: forgot root password

Post by Mute Ant »

"Linux Mint 18.3 Sylvia... I'm a new user." From the top then...

o Administrator actions are authorised using sudo and your normal log-in password. If you can't use Update Manager, it's not a problem with knowing or having a password for the root account. If the following command prints OKAY there's not a lot wrong...
sudo echo OKAY

o Freshly installed Sylvia doesn't have a root password. If you set one, that's your option, but forgetting it won't affect the normal operation of Mint. If your primary account sudo privilege is intact, you can delete-and-lock the root account password back to the default Mint state without knowing what it was...
sudo passwd -dl root

o If a user has an encrypted home folder, fiddling with their password using root-privileges is 'unwise'. You can change the log-in password, but that doesn't update the keyring. That user loses access to their encrypted data until the password is changed back. If any user 'forgets' the password for something encrypted, that data is lost beyond hope of recovery until the correct password is used, by remembering it, or by repeated guessing.
howardballinger

Re: forgot root password

Post by howardballinger »

Thanks to all, I'm just getting time to try some of those approaches today.
It's not about my user password, I know that. It's the root password.

And sudo commands fail -- the screen asks for my password, and doesn't accept my user password ... apparently what it needs is my root password, and the problem in the first place is to find out what my root pw actually is! screenshot attached.

The Update Manager when I hit "Install updates" says "Authentication as superuser is required to perform this action. Password for root : ___________". And Users and Groups says the same thing.

And Frank, I didn't change my user login once I set it up during install

I think I really do need to set a new root password somehow. How can I do that?

Thanks -- HB
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: forgot root password

Post by austin.texas »

What happens why you try MuteAnt's test?

Code: Select all

sudo echo OKAY
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
User avatar
JerryF
Level 16
Level 16
Posts: 6571
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: forgot root password

Post by JerryF »

howardballinger wrote: ...
And sudo commands fail...

The Update Manager when I hit "Install updates" says "Authentication as superuser is required to perform this action. Password for root : ___________". And Users and Groups says the same thing.
I have a feeling that your user account is not in the sudo group.

Please run this command in Terminal:

Code: Select all

id
Copy and paste the results.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: forgot root password

Post by pbear »

howardballinger wrote:I think I really do need to set a new root password somehow.
No, what you really need to do is determine whether you're in the sudo group and, if not, fix that. If you created a root password, what you should do is restore the default, which is not to have one. Mute Ant told you how to do this above. In Terminal, run sudo passwd -dl root.
paul_k

Re: forgot root password

Post by paul_k »

Hi all, I have the same exact issue as the OP right after installing v19. Never set a root passwd but it asks for it for all installations. This is what I get per your suggestions:

lm19-home@lm19home-Inspiron-5559:~$ sudo echo OKAY
[sudo] password for lm19-home:
Sorry, user lm19-home is not allowed to execute '/bin/echo OKAY' as root on lm19home-Inspiron-5559.

lm19-home@lm19home-Inspiron-5559:~$ sudo passwd -dl root
[sudo] password for lm19-home:
Sorry, user lm19-home is not allowed to execute '/usr/bin/passwd -dl root' as root on lm19home-Inspiron-5559.

lm19-home@lm19home-Inspiron-5559:~$ id
uid=1000(lm19-home) gid=1000(lm19-home) groups=1000(lm19-home),4(adm),24(cdrom),30(dip),46(plugdev),115(lpadmin),127(sambashare)

Please help. TIA.
User avatar
Moem
Level 22
Level 22
Posts: 16233
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: forgot root password

Post by Moem »

paul_k wrote: Sun Oct 21, 2018 12:41 am Hi all, I have the same exact issue as the OP right after installing v19. Never set a root passwd but it asks for it for all installations.
No, it really doesn't. It prompts you to set up a user password. You might want to read Mute Ant's post above again.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: forgot root password

Post by austin.texas »

You can use the instructions I gave previously - viewtopic.php?p=1542069#p1417543
to set a user (administrative) password for user lm19-home
You might then, after that, have to make sure that user lm19-home is a member of the sudo group.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
bassplayer

Re: forgot root password

Post by bassplayer »

austin.texas wrote: Fri Jan 19, 2018 2:39 pm If you can't remember your user's password, you can set a new one.
Boot the computer and select your Mint OS in the Grub menu, but do not press ENTER - instead press e (for EDIT).
Arrow down to the line that starts with "linux"
It will look something like this: linux /boot/vmlinuz-3.16.0-38-generic root=UUID=b1bde976-50e2-4c32-a760-17b091b4202f ro quiet splash $vt_handoff
Go to the end of that line. Delete the words "quiet splash $vt_handoff" if that is there, and put: systemd.unit=multi-user.target
Then press F10 to boot. That will boot to a root shell.
Enter: passwd yourusername (whatever your user name is...)
Press Enter. It will request the new password (twice).
Note: when you type your new password, it will not display on the screen (for security reasons).
When complete, press Ctrl+Alt+Delete to reboot.
So in essence, you can set the root password by using this method and then at any terminal after rebooting, you can just use $ su - to drop into a root shell and not have to deal with that annoying sudo business. :mrgreen: Gonna have to give that a try.
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: forgot root password

Post by austin.texas »

You can do that but it is NOT recommended. Use an administrative account - with sudo.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
bassplayer

Re: forgot root password

Post by bassplayer »

austin.texas wrote: Mon Oct 22, 2018 10:06 am You can do that but it is NOT recommended. Use an administrative account - with sudo.
You're not my supervisor! :mrgreen:

Just glad to be rid of

Code: Select all

sudo
. I at least want to get back to some sanity when using the terminal like I did with Slackware for the past 10 years....
kukamuumuka

Re: forgot root password

Post by kukamuumuka »

austin.texas wrote: Mon Oct 22, 2018 10:06 am You can do that but it is NOT recommended. Use an administrative account - with sudo.
Hammer is a bad tool for a child! Do not give it to him or her. :wink:
bassplayer

Re: forgot root password

Post by bassplayer »

Actually, I found an easier way and you don't need to mess with grub:

Code: Select all

sudo passwd root
:mrgreen:

But, we're getting off topic here...
Locked

Return to “Installation & Boot”