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
  • 131
  • 1
  • 5
  • 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 Apr 02 '15 at 23:52
  • 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 Apr 03 '15 at 00:13
  • 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](http://unix.stackexchange.com/a/102625/22222). Is this a machine you administrate? If so, please edit and explain your SELinux setup. – terdon Apr 03 '15 at 00:32

1 Answers1

1

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

maddo7
  • 131
  • 1
  • 5