On a remote server, it used to be the case that it was possible to execute a command as another user using the sudo -u command but lately, I have been unable to accomplish this. When I do I receive the following error:
sudo -u lool ./autogen.sh
/var/tmp/scltjLjKc: line 8: -u: command not found
so I'm having to resort sudo-ing to root then su into the user before being able to execute the command. What could be the possible cause of this?
Since this never got an answer, the comment by Zoredache is correct. Installing one of the
devtoolset-*
software collections is responsible for this problem. I can't imagine who thought hijackingsudo
was a reasonable or responsible thing to do.The quickest way to resolve it, without messing with your path and possibly breaking the development tools you've just installed is to do this:
Of course, replace
devtoolset-2
with whatever version you're using.