Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Accidentally Removed Myself From All Admin Groups...

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
jrredho
Posts: 13
Joined: 2015-03-03 18:00

Accidentally Removed Myself From All Admin Groups...

#1 Post by jrredho »

Hey All,

Knucklehead that I am, I somehow neglected to add the '-a' argument to the usermod command when adding myself to another group and now no longer belong to all of the default groups that I was in after installing Stretch with sudo access only.

Would someone here be so kind as to instruct me on now the re-claim my membership in all of the default administrative groups, such as sudo, lpadmin, etc, that one is added to at install time?

Many thanks!

cheers,
john

jrredho
Posts: 13
Joined: 2015-03-03 18:00

Re: Accidentally Removed Myself From All Admin Groups...

#2 Post by jrredho »

Hey Wizard,

Thanks so much for the help!

But (there's always one of these, isn't there), unfortunately, that prompts a couple more questions:

(1) My root partition, and really all partitions other than /boot, are LVM2 logical volumes on a LUKS-encrypted disk partition. Will your process still work?

(2) Since I was advised, strongly iirc, during installation not to set a root account. How would I go back to that original setup?

Thanks again,
john

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Accidentally Removed Myself From All Admin Groups...

#3 Post by Segfault »

When in single user mode you are root and can fix your user groups without setting root password.

jrredho
Posts: 13
Joined: 2015-03-03 18:00

Re: Accidentally Removed Myself From All Admin Groups...

#4 Post by jrredho »

Thanks, wizard, for all of your detailed help!

cheers,
john

ps You too Segway :)

jrredho
Posts: 13
Joined: 2015-03-03 18:00

[Solved]Re: Accidentally Removed Myself From All Admin Group

#5 Post by jrredho »

wizard10000 wrote:Can't help you with group membership because I'm not on a Linux box but can tell you how to get root back -

* At the grub menu hit 'e' to edit kernel arguments.

* At the end of the line that starts with "linux", add

Code: Select all

init=/bin/bash
and hit Esc or F10 to boot.

* Now that we're in single user mode, mount your root filesystem read-write like this:

Code: Select all

mount -no remount,rw /
* Change root's password like this:

Code: Select all

passwd root
* Reboot and you should be able to use su to get things fixed.

Hope this helps -

edit: I can help after all. Thanks to rclone and gdrive I posted my /etc/group to http://paste.debian.net/983731

My username in the file is wizard and I'm a member of all the groups that contain that username - plus the group that *is* my username.
Hey Wizard,

Just a quick followup: Since I the grub2 entry included the appropriate initramfs, which was aware of the LUKS/LVM thing, I followed these directions and accomplished exactly what I was trying to do. And having a template for admin-related default group membership really helped, too. Thanks again!

But there was one minor tweak: Disabling the root password access didn't work by setting it to *empty* using the method you suggested. The passwd command refused to accept it. Instead I had to to use the '-l' passwd option---and I'm still not positive that that accomplishes what I was hoping it would. *Sigh* There's always one more thing...

cheers,
john

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Accidentally Removed Myself From All Admin Groups...

#6 Post by Segfault »

Some folks just love doing things the hard way. I can think of even more difficult way to edit user groups, you wanna hear it? It involves chrooting and much more! I guarantee you will be fiddling for hours, that's what you enjoy, right?

Sorry, couldn't help, I'm a big fan of common sense myself. 8)

jrredho
Posts: 13
Joined: 2015-03-03 18:00

Re: Accidentally Removed Myself From All Admin Groups...

#7 Post by jrredho »

Segfault wrote:Some folks just love doing things the hard way. I can think of even more difficult way to edit user groups, you wanna hear it? It involves chrooting and much more! I guarantee you will be fiddling for hours, that's what you enjoy, right?

Sorry, couldn't help, I'm a big fan of common sense myself. 8)
If only there had been a way for you to have impacted that in this case...

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Accidentally Removed Myself From All Admin Groups...

#8 Post by Segfault »

Yes, I told you not to mess with root password because it is not necessary. Once booted in single user mode all you had to do was to use a tool like vigr to fix your user account. But of course, no one can help people who do not listen.

jrredho
Posts: 13
Joined: 2015-03-03 18:00

Re: Accidentally Removed Myself From All Admin Groups...

#9 Post by jrredho »

Segfault wrote:Yes, I told you not to mess with root password because it is not necessary. Once booted in single user mode all you had to do was to use a tool like vigr to fix your user account. But of course, no one can help people who do not listen.
Yeah, I tried that, and guess what? It didn't work. To be fair, I used usermod directly since using a tool like vigr would've required me to know something about vi, and to know that such a tool as vigr existed in the first place. When I used usermod, I got complaints from the command with the net assessment being that it didn't update my groups. Go figure; I honestly don't know what state I'd put myself in. So I decided to do it the long way, rebooted su root'd then used usermod with no issues. As I mentioned I then reset the root password.

I think all of this means that I've now given you free license to feel twice as smug as you originally did, since now you know that it took me twice the effort than you thought it had. You should be thinking about buying me a beer!

john

Post Reply