Can't Log in and lost root rights

Hi, i made my very first big Linux mistake with a wrong chmod command and now can’t log in an lost my root rights. With anything regarding sudo Displays:

“sudo: /usr/bin/sudo muss dem Benutzer mit UID 0 gehören und das »setuid«-Bit gesetzt haben”

And the command “ls -l /usr/bin/sudo” Displays:

“-rwxr-xr-x 1 root root”

The os boots, but i can’t log in as my password is not accepted anymore. What can i do? Start recovery mode? If so how? I am beyond confused and really need help

I have been using Linux for nearly 30 years. Last week, whilst tidying up an old install, I accidentally deleted my /usr directory and not the one on the other drive. :poop: happens!

Option 1:

Depending on how much damage caused, it may be quicker to launch the install media and recover personal files and reinstall.

Option 2:

chroot in from the live media and try to reinstall misbehaving packages.

Option 3:

Does the su command work? Or did you clobber it as well? If it does try:

su 
pacman -Syu sudo --overwrite='*'

And see if that helps.

1 Like

I added 'init=/bin/bash’ to my boot of EOS and can at least enter my system to some degree, but when i execute the command sudo, i get:

Sudo: /etc/sudo.conf is world writeable
Sudo: /etc/sudo.conf is world writeable
Sudo: /etc/sudoers is world writeable
Sudo: Error initializing audit Plugin sudoers_audit

Unfortunately the last command didn’t work and i don’t have the stick i used to install EOS with me :frowning:

Without the install media (you need it to chroot), you are a bit stuffed :frowning:

Perhaps run0 could work from the root shell OP seems to be able to get in.

1 Like

For some reason even commands like cd failed now, i’ll go home (maybe cry a bit on the way), reinstall and double check what i type in my terminal

1 Like

Maybe you show exactly what chmod command you did might help also.

Edit: So what you are saying is you lost your roots and now you aren’t even sudo! :grin:

Will be pretty embarrassing but it was “sudo chmod -R -777 /” with the last slash being a typo or rather my pinky being to fast on the enter key…

Well, that is a big one… Is it even possible to do something about that? I don’t think so. You can still save your data with a live boot (for example), but the system itself probably is unusable now.

Yeah, there was nothing i could do, i reinstalled everything and got everything running like before now with absolutely no data loss, due to regular backups, i only lost a day of productivity; at least i learned how to not use chmod

2 Likes

Don’t be embarrassed we have all done our moment in the walk of shame, rather publicly or privately. As noted the best thing you can do at this point is to boot up with a live USB and backup your personal data and then reinstall.

3 Likes