[SOLVED] How to RESTORE ROOT PERMISSIONS on my User?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
ngiampaoli
Level 1
Level 1
Posts: 13
Joined: Tue Aug 11, 2015 12:17 pm
Location: Cordoba, Argentina

[SOLVED] How to RESTORE ROOT PERMISSIONS on my User?

Post by ngiampaoli »

Hi all,
In order to activate permissions for Arduino, a friend told me to run this command "sudo usermod -G dialout nicolas" (nicolas is my username)

After I run that command, I lost ROOT permissions for my user.
I checked on internet and the correct command to run should be "sudo usermod -aG dialout nicolas" (my friend forget the "a")

How can I Restore Root Permission for my user?

I don't have the option to enter on recovery mode because Grub does not show the option, it boot directly.

Please, help me.

Thanks in advance.
Nicolas.

Note: At the end you will find my solution
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
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by trytip »

which sudo doesn't work?
sudo apt update gives you what?
Image
ajgringo619

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by ajgringo619 »

I think he replaced all of his groups with just the one - dialout. Does your root account have a password? If not, do you have access to a live media USB/DVD?
User avatar
ngiampaoli
Level 1
Level 1
Posts: 13
Joined: Tue Aug 11, 2015 12:17 pm
Location: Cordoba, Argentina

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by ngiampaoli »

trytip wrote: Mon Oct 01, 2018 2:53 pm which sudo doesn't work?
sudo apt update gives you what?
It doesn't work. It say I am not allowed to run the command.....
User avatar
ngiampaoli
Level 1
Level 1
Posts: 13
Joined: Tue Aug 11, 2015 12:17 pm
Location: Cordoba, Argentina

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by ngiampaoli »

ajgringo619 wrote: Mon Oct 01, 2018 3:22 pm I think he replaced all of his groups with just the one - dialout. Does your root account have a password? If not, do you have access to a live media USB/DVD?
I don't have root account enabled.

Yes, I have the linux mint usb media to boot from. Can you explain me how to proceed from there?
kukamuumuka

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by kukamuumuka »

Code: Select all

su
usermod -aG adm,sudo your_username_here
If that does not work, boot computer to the init-shell and run in the prompt #

Code: Select all

usermod -aG adm,sudo your_username_here
For getting into init-shell, edit boot line as

Code: Select all

linux	/boot/vmlinuz- .......  rw init=/bin/bash
User avatar
ngiampaoli
Level 1
Level 1
Posts: 13
Joined: Tue Aug 11, 2015 12:17 pm
Location: Cordoba, Argentina

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by ngiampaoli »

administrollaattori wrote: Mon Oct 01, 2018 4:12 pm

Code: Select all

su
usermod -aG adm,sudo your_username_here
After I put su it say autentication failure

if I tried
sudo usermod -aG adm,sudo your_username_here it say the user xxx is not allowed to run .....
lazarus

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by lazarus »

Try it the 2nd way administrollaattori suggested. That puts you straight in as root, not your user, so should work without permission issues.

ie. Reboot into the grub screen (you may need to hold down shift while booting) and press E when at the selection list.

Find the line that starts with "linux /boot/vmlinuz" etc and after the part that reads "quite splash" insert rw init=/bin/bash so the line now reads something like:

"linux /boot/vmlinuz-<...kernel info & some parameters...> quiet splash rw init=/bin/bash <...more parameters...>"

Press F10 to continue booting with the edited line; this should put you straight into a terminal where you can enter the suggested command.

Code: Select all

usermod -aG adm,sudo your_username_here
gm10

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by gm10 »

The easier/safer way to get to a root shell is to reboot, hold shift after the BIOS logo until the GRUB menu appears (sometimes you need to press Esc, too), then select Advanced options and pick the first entry that says Recovery mode, then from the menu that appears choose root.

That boots you to a root shell, where you can run the usermod command suggested above.
User avatar
ngiampaoli
Level 1
Level 1
Posts: 13
Joined: Tue Aug 11, 2015 12:17 pm
Location: Cordoba, Argentina

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by ngiampaoli »

I solved the problem.
I boot from a live usb image and I edit the file /etc/groups
I add my "username" to groups like root, adm, and others. (I was only on group dialuot)

Tomorrow I will check in other linux wich groups are missing for my user in order to have all running well.
ajgringo619

Re: How to RESTORE ROOT PERMISSIONS on my User?

Post by ajgringo619 »

Great to here. On my system (Mint 19), I'm in these groups: me adm cdrom sudo dip plugdev lpadmin sambashare vboxusers. I would add yourself to all of these, excepting vboxusers (unless you're running VirtualBox as a host system).
Locked

Return to “Software & Applications”