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

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
ngiampaoli
Level 1
Level 1
Posts: 11
Joined: Tue Aug 11, 2015 12:17 pm

[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 ngiampaoli on Tue Oct 02, 2018 7:24 pm, edited 1 time in total.
User avatar
trytip
Level 13
Level 13
Posts: 4901
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
Level 8
Level 8
Posts: 2100
Joined: Thu Mar 01, 2018 8:36 pm
Location: San Diego, California, USA

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?
Mint 20 XFCE [kernel 5.4.0-52-generic]
Ryzen 7 2700X Eight-Core w/16 GB RAM
AMD Radeon R9 290 w/4GB RAM
Image
ngiampaoli
Level 1
Level 1
Posts: 11
Joined: Tue Aug 11, 2015 12:17 pm

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.....
ngiampaoli
Level 1
Level 1
Posts: 11
Joined: Tue Aug 11, 2015 12:17 pm

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?
User avatar
kukamuumuka
Level 16
Level 16
Posts: 6697
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

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
ngiampaoli
Level 1
Level 1
Posts: 11
Joined: Tue Aug 11, 2015 12:17 pm

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
Level 3
Level 3
Posts: 153
Joined: Mon Jul 02, 2018 11:36 pm
Location: Oberon, OZ

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
- Andy

I may be weird but I'm saving up to become eccentric.
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

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.
ngiampaoli
Level 1
Level 1
Posts: 11
Joined: Tue Aug 11, 2015 12:17 pm

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
Level 8
Level 8
Posts: 2100
Joined: Thu Mar 01, 2018 8:36 pm
Location: San Diego, California, USA

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).
Mint 20 XFCE [kernel 5.4.0-52-generic]
Ryzen 7 2700X Eight-Core w/16 GB RAM
AMD Radeon R9 290 w/4GB RAM
Image
Post Reply

Return to “Software & Applications”