LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-17-2021, 11:39 AM   #1
Disaster2life
LQ Newbie
 
Registered: Sep 2021
Posts: 5

Rep: Reputation: Disabled
Unhappy I locked myself out of sudo privileges, anyways to save myself?


I have been having a GREAT DAY.
I was messing around with Ardour today, but I had no audio output, I thought it had something to do with not having JACK, I decided to follow a tutorial and did so, but that didn't fix it and I actually lost all audio to my whole system, so I decided to undo all that I did, one of the step was to add my user account to a special music group, 5 minutes after finding out how to remove myself from it and doing it, I found out I had lost my sudo privileges, and I am the only user on the system. I looked up tutorials to fix this but all of them required me to get access to the root shell, which I can't because when I boot into the systemmd-boot, I don't have an option to get to recovery, any help with me just being able to get back my system without having to start over?
I use PopOS 21.04
I have a dell XPS 12-9q33(if that's relevant)
any help would be appreciated
 
Old 09-17-2021, 11:54 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
Do you have a Live image to boot from instead? If so you could boot that, then mount the root partition, and then edit its /etc/group file.
 
Old 09-17-2021, 12:11 PM   #3
Disaster2life
LQ Newbie
 
Registered: Sep 2021
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am on a live image right now, what exactly do I have to edit? I don't want to mess it up more
 
Old 09-17-2021, 12:17 PM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
If you mount the main hard drive, there will be a file etc/group inside the mount point. Find that and make a copy of it called etc/group.orig or something. Then edit etc/group on the line starting with "sudo" by appending your account name on the line. If there is already something on that line, put a comma in between the names.

Code:
...
sudo:x:127:disaster2life
...
Or, if there is already one or more members of the group, add a comma:

Code:
...
sudo:127:foo,bar,disaster2life
...
Either way, everything to the left of the last colon should be left alone.

Edit: there is also the file gshadow which should get the same treatment, for thoroughness, but the above is the minimum for that approach. chroot is another way.

Last edited by Turbocapitalist; 09-17-2021 at 12:30 PM.
 
Old 09-17-2021, 12:23 PM   #5
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
It may be simpler to boot single user mode and attempt to set a root password. Reboot, log in as root and do whatever needs to be done. The sudoers file may be misconfigured.

"Tutorials" are supposed to teach - many do not. They often consist of a set of, possibly outdated, instructions which may not be the best approach.

Last edited by cynwulf; 09-17-2021 at 12:25 PM.
 
1 members found this post helpful.
Old 09-17-2021, 12:50 PM   #6
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,179

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
When you boot the system, you should be able to press e to edit the boot option. Then at the end of the 'linux' line add
Code:
systemd.unit=rescue.target
then press F10 to boot.
This is a temporary change and is not saved.
 
2 members found this post helpful.
Old 09-18-2021, 12:41 AM   #7
Disaster2life
LQ Newbie
 
Registered: Sep 2021
Posts: 5

Original Poster
Rep: Reputation: Disabled
Wink

Quote:
Originally Posted by uteck View Post
When you boot the system, you should be able to press e to edit the boot option. Then at the end of the 'linux' line add
Code:
systemd.unit=rescue.target
then press F10 to boot.
This is a temporary change and is not saved.
Oh thank you very much, I was able to boot into recovery mode and add myself back into the sudo group.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using FAT32 anyways? kiddo Linux - General 5 01-15-2005 10:14 PM
confused/curious about your political beliefs??? If not, read this anyways... eskiled General 9 10-19-2004 10:29 AM
it told me not to compile Nvidia Riva . im doing it anyways ! qwijibow Linux - Software 0 10-10-2004 08:27 AM
what is this file for anyways? captgoodnight Linux - Newbie 2 08-17-2002 11:26 PM
dumb question but anyways... 43w45r3e Linux - Distributions 2 01-26-2002 03:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration