User avatar
matthw
Posts: 11
Joined: Fri Oct 27, 2017 10:49 pm

[SOLVED] Accidentally removed myself from all default groups

Fri Feb 02, 2018 9:32 pm

I was using the usermod command to add myself to a group but I forgot the -a flag and I removed myself from all other groups.

Now I can't use sudo anymore.

How can I restore all my user default permissions?

Thanks
Last edited by matthw on Sat Feb 03, 2018 12:08 pm, edited 1 time in total.

User avatar
kyrios
Posts: 1856
Joined: Thu Sep 22, 2016 4:20 pm

Re: Accidentally removed myself from all default groups

Sat Feb 03, 2018 12:05 am

matthw wrote:
Fri Feb 02, 2018 9:32 pm
I was using the usermod command to add myself to a group but I forgot the -a flag and I removed myself from all other groups.

Now I can't use sudo anymore.

How can I restore all my user default permissions?

Thanks
Boot from the live ISO, mount the / (root partition) - the one from your internal disk, not the one from the live iso that will be mounted anyway.
edit the file /etc/group of the partition you mounted (with sudo) and add your user in the groups you need or at least in the sudo group. Save the file and reboot normally.

User avatar
matthw
Posts: 11
Joined: Fri Oct 27, 2017 10:49 pm

Re: Accidentally removed myself from all default groups

Sat Feb 03, 2018 12:08 pm

kyrios wrote:
Sat Feb 03, 2018 12:05 am
matthw wrote:
Fri Feb 02, 2018 9:32 pm
I was using the usermod command to add myself to a group but I forgot the -a flag and I removed myself from all other groups.

Now I can't use sudo anymore.

How can I restore all my user default permissions?

Thanks
Boot from the live ISO, mount the / (root partition) - the one from your internal disk, not the one from the live iso that will be mounted anyway.
edit the file /etc/group of the partition you mounted (with sudo) and add your user in the groups you need or at least in the sudo group. Save the file and reboot normally.
It works!!!
Thanks you

Return to “Other Questions”