When I try to switch to root using sudo -i
i get the error /var/tmp/sclDvf3Vx: line 8: -i: command not found
... However, su -
works which I will continue to use. I'm by no means a linux system administrator so the environment is still pretty foggy to me. I guess my questions are:
- Why is the error being thrown?
- What's the difference between the two commands?
- Why would you use one over the other?
Update:
I'm using CentOS version: CentOS release 6.6 (Final)
Here's the output from some commands I was asked to run, in the comments below.
type sudo
:sudo is /opt/centos/devtoolset-1.1/root/usr/bin/sudo
sudo -V
:/var/tmp/sclIU7gkA: line 8: -V: command not found
grep'^root:' /etc/passwd
:root:x:0:0:root:/root:/bin/bash
Update:
This was added to my non-root user's ~/.bashrc a while back because i needed C++11 support. When I comment it out, re-ssh in, I can run sudo -i just fine without any errors.
if [ "$(gcc -dumpversion)" != "4.7.2" ]; then
scl enable devtoolset-1.1 bash
fi
alias
for yoursudo
command?sudo
which is not the normal sudo command. Given that it doesn't understand sudo's options, it's clearly not some standard thing. Either use/usr/bin/sudo
or ask your local administrators (who should really have told you about this when they gave you sudo powers).