Uid 0? setuid bit?

I don’t really know what’s going on, a few days ago I started having the following problems:
1.- When I want to change to root (for example), it asks me for a password that I did not create or have. But I can log in to my normal account.
2.- a) When I put in the console “sudo passwd root” I get “/usr/bin/sudo must be owned by uid 0 and have the setuid bit set”.
b) If I put “sudo pacman -Syu” in the console i get the same as in a).

What should I do?

login as root and change permissions to sudo program as like this:
rwsr-xr-x 1 root root 248456 Nov 5 11:08 /usr/bin/sudo

Hello,
rwsr-xr-x is a command? does not recognize the rwsr-xr-x command.

chown root /usr/bin/sudo
chmod u+s /usr/bin/sudo

1 Like

welp, now i can’t log as root :sob:

OMG :man_facepalming:

your normal user account is a member of the group “wheel”
that is the group that has got admin rights
this means:
your normal user account (the first one, created when you installed the system) has got admin rights

to get root you type
sudo su -
or
sudo pacman -Syu
then give your normal users password

i get the same " must be owned by uid 0 and have the setuid bit set” when i put sudo su -

then you managed to change something else

the normal response to
sudo su -
is:
[sudo] password for nachlese:

What is returned when you type:

ls -al /usr/bin/sudo

?

-rwxr-xr-x 1 root root 248456 Nov 5 04:08 /usr/bin/sudo

as he said:

before you can do that
you probably have to become root another way:

su -
give your password
then:
chmod u+s /usr/bin/sudo

after that
CTRL+D
or type: exit

so that you don’t keep working as root

1 Like

the problem is that doesn’t accept my password and i didn’t create a password for root (doesn’t accept a blank space nor my password)

I don’t know what you mean.
You just need your normal password.

Example please! Full output.

what happens when you type:
su -
and hit Enter

su -
password:
su: authentication failure

good - you somehow managed to break your system :sunglasses:

you can try to find out how you did it by going through your shell history

type:
history

and you see a list of the recent commands
one of them ought to give you a clue as to what you did

The access rights to the sudo program are screwed - and without root rights you can’t fix that.

the only strange thing is “sudo - s” and “sudo - i”

Several ways to fix it.
I’d try it by booting a live system, accessing the drive with your / filesystem
(where the sudo program is)
and change the rights from there

Do you understand how to do that?

Before you go:

How did you manage to change the permissions on the sudo program? and why?
This is what I hoped to find evidence of in the shell history.

more or less. i need a usb, right? (for the live system)

correct

I added a question to my previous post.

The command you want to run is like this:
chmod u+s /usr/bin/sudo
you just need to amend the path

i always make sure to verify what I type in the console before pressing enter. I noticed this problem when i tried to upgrade my system.
By the way, thanks for the help.

… you typed those commands, you should know why :man_shrugging: