On Ubuntu 12.04, when I do
sudo -u <user> ls
env: -u: No such file or directory
This happens for any command and any user for
<user>, including myself and root.
Any ideas how to troubleshoot this?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
sudo was actually running an alias:
$ alias sudo alias sudo='sudo env PATH=$PATH'
/usr/bin/sudo directly skipped the alias and resolved the problem.
Alternatively, you can open the
.bashrc file in your home directory and comment out the line:
alias sudo='sudo env PATH=$PATH'
source .bashrc again, and (for good measure), run