Lost Sudo access - password not accepted

Big screw up - in trying to get something working I removed myself from Sudo access. Cannot get to root. Cannot install anything to help with this. Can’t get to Grub. I tried holding down shift while booting and no grub menu comes up no matter what I try including Esc or left Shift or right Shift. Ubuntu mate just boots and loads to the desktop. Other than formating the install and starting all over again, is there anything that I can do to get to a Root Terminal or Recover to put my name back into the Sudoers file. What a mess! This is on a RaspPi 2 - no bios. Just the SD card with the ubuntu mate image.

Thanks.

hi - try this

in command line write:

passwd

new unix password appear (put your new pass)
confirm with enter

reboot

perhaps is a solution -

No, all that does is change the password - using the new password I still have no sudo access. Without that or some way to get to a recovery mode there seems to be no way for me to correct this. Raspberry Pi has no BIOS and has no GRUB. Anything that I try to do asks to authenticate and with no administrator at all in the system that seems to be impossible.

I am going to format the SD card with Ubuntu and start over after two days of getting it to actually work…

Anyone with a RaspPi using Ubuntu-Mate be aware that if you need to add yourself to a group to be able to access a service, you run the risk of removing yourself from suduers and will no longer have administrator access. This is how I got myself into this mess. To run OMXplayer I needed to add to a group - followed some forum post as to how to do that and that deleted me from suduers. I thought that admins were in all groups. Apparently not. From now on, I will create another user with admin privileges as a back up before making any changes.

Which post did you follow? please leave a link.

Furthermore: be sure to grant that user sudo rights:

sudo gpasswd -a <username> sudoers

If you lose the rights again you can login with that username and use rhe same command to restore your rights.

Another solution (not recommended and a security risk) is to enable root password:

sudo passwd root

Hope it helps

1 Like

I could do nothing that required sudo without administrator rights. My profile became modified from Administrator to “Custom”. I scraped the install and started over again by formatting the SD Card, rewriting the original downloaded image file to it, and started over again.

The first thing I then did was to create a second User with Admin privileges. Once the new install was completely set up and functioning as I want it, I created a back up image of the install.

All is well now - time wasted - but well.
Thank you.

1 Like