sudo: effective uid is not 0, is sudo installed setuid root? for normal users

2

strangely I cannot run the sudo command for every new account I create that is not root. The server is completely new and wasn't touched so I don't know what's wrong.

for every command I try to run with sudo with a normal user I get

sudo: effective uid is not 0, is sudo installed setuid root?

I tried various solutions I found on the web including

chmod u+s /usr/bin/sudo

and

chown -R root:root /usr/bin

but nothing helped.

ls -l `which sudo`

shows

-rwsr-xr-x. 1 root root 123832 Oct 15 02:14 /usr/bin/sudo*

and finally

type -a sudo | awk '{print $NF}' | xargs ls -lF

gives

-rwsr-xr-x. 1 root root 123832 Oct 15 02:14 /usr/bin/sudo*

what could be the issue?

maddo7

Posted 2015-04-02T23:10:30.253

Reputation: 131

Was that ls -Fl which sudo or do you actually have a file called /usr/bin/sudo*? Also, is that really a . in the last position of the permissions string (-rwsr-xr-x.)? Finally, please edit your question and add the output of type -a sudo | awk '{print $NF}' | xargs ls -lF. Just to be on the safe side. – terdon – 2015-04-02T23:52:41.430

the file is called sudo, the * is added by putty and yes, there's a dot. I'll now add the result of your command – maddo7 – 2015-04-03T00:13:49.417

Oh, please also clarify that you're using putty. I doubt that will make a difference but the more information we have, the likelier someone can find an answer. OK, the . is indicative of a SELinux issue. Is this a machine you administrate? If so, please edit and explain your SELinux setup.

– terdon – 2015-04-03T00:32:43.660

Answers

1

For some reason new users automatically used jailshell which caused this incident. Switching to bash fixed the issue.

maddo7

Posted 2015-04-02T23:10:30.253

Reputation: 131