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

 

 

 

sudo and root access invalidated and grub timeout set at 0

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
maidastach
Posts: 7
Joined: 2022-01-23 01:32
Has thanked: 1 time
Been thanked: 1 time

sudo and root access invalidated and grub timeout set at 0

#1 Post by maidastach »

Hello there,
I am a Bullseye user,
i was following a guide to start developing with Ionic and the official doc, to install the framework cli globally, has suggested me to run this command

Code: Select all

$ sudo chown -R $(whoami) /usr/local/{lib/node_modules,bin,share}
$ sudo chown -R $(whoami) ~/.npm ~/.npmrc
instead of using sudo(to avoid future complications)

Unfortunately by mistake i ran instead

Code: Select all

$ sudo chown -R $(whoami) /usr/{lib/node_modules,bin,share}
$ sudo chown -R $(whoami) ~/.npm ~/.npmrc
The situations evolved in my unavailability to run the

Code: Select all

sudo
command, getting:

Code: Select all

sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
i was trying to re-set the permissions through

Code: Select all

su
but i cannot remember the password.

So i was trying to run the Recovery Mode but my Grub Timeout is set to 0 and i cannot find a way to get into it.

I also tried to run a shell from the usb installlation iso, and mounting my dev with the command

Code: Select all

mount /dev/sda1 /mnt
but not working.

Any help?

Thanks

maidastach

User avatar
canci
Global Moderator
Global Moderator
Posts: 2502
Joined: 2006-09-24 11:28
Has thanked: 136 times
Been thanked: 136 times

Re: sudo and root access invalidated and grub timeout set at 0

#2 Post by canci »

You should be able to get into Grub by holding the Shift key during boot.
Image Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe

READ THIS:

* How to Post a Thread Here
* Other Tips and Great Resources

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: sudo and root access invalidated and grub timeout set at 0

#3 Post by p.H »

Post the full error message instead of "not working".
Did you try to mount the right partition ?

maidastach
Posts: 7
Joined: 2022-01-23 01:32
Has thanked: 1 time
Been thanked: 1 time

Re: sudo and root access invalidated and grub timeout set at 0

#4 Post by maidastach »

canci wrote: 2022-01-23 08:58 You should be able to get into Grub by holding the Shift key during boot.
Tried many time, also with the Esc key, but it doesn't work.
i guess because of the TimeOut set at 0 that makes it to quick

User avatar
canci
Global Moderator
Global Moderator
Posts: 2502
Joined: 2006-09-24 11:28
Has thanked: 136 times
Been thanked: 136 times

Re: sudo and root access invalidated and grub timeout set at 0

#5 Post by canci »

You could restore the permissions by booting from a live usb and mounting your hard drive, then repairing the permissions. Or you could just reinstall. If you have a dedicated /home partition, you'd just reformat / and install Debian again.
Image Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe

READ THIS:

* How to Post a Thread Here
* Other Tips and Great Resources

maidastach
Posts: 7
Joined: 2022-01-23 01:32
Has thanked: 1 time
Been thanked: 1 time

Re: sudo and root access invalidated and grub timeout set at 0

#6 Post by maidastach »

canci wrote: 2022-01-23 10:36 You could restore the permissions by booting from a live usb and mounting your hard drive, then repairing the permissions. Or you could just reinstall. If you have a dedicated /home partition, you'd just reformat / and install Debian again.
I solved this way.
This morning i was unable to mount my filesystem in rescue mode as mentioned in the main post.
I have re-downloaded the Bullseye Iso Image and the rescue shell did its job.

if anyone interested i ran:

Code: Select all

mount -o remount, rw /
mount -a
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
then restarted

Thanks to everyone!

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: sudo and root access invalidated and grub timeout set at 0

#7 Post by p.H »

So you only fixed the ownership of sudo, not the other files you messed. Expect trouble.

maidastach
Posts: 7
Joined: 2022-01-23 01:32
Has thanked: 1 time
Been thanked: 1 time

Re: sudo and root access invalidated and grub timeout set at 0

#8 Post by maidastach »

Actually i have also ran

Code: Select all

chown root:root /usr
chmod 4755 /usr
It seems working, what do you think?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: sudo and root access invalidated and grub timeout set at 0

#9 Post by p.H »

Without -R this fixed only the ownership of the /usr directory, not of its contents.
chmod is not needed, as your original command was only chown.

maidastach
Posts: 7
Joined: 2022-01-23 01:32
Has thanked: 1 time
Been thanked: 1 time

Re: sudo and root access invalidated and grub timeout set at 0

#10 Post by maidastach »

Right!
Make sense.

Thanks

Post Reply