I have sudo access on my friends server, running centos-6.3, but when I try to run some commands like sudo vim /var/www/html/index.html
I get an error sudo: vim: command not found
I can, however, run sudo su
and then vim /var/www/html/index.html
and it works as expected.
echo $PATH
and sudo echo $PATH
both yield:
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/jared/bin
sudo which vim
however yields:
which: no vim in (/sbin:/bin:/usr/sbin:/usr/bin)
I've tried adding
export PATH=$PATH:/usr/local/bin
to the /root/.bashrc
which as fixed the issue when using sudo su
but not just sudo <command>
.
How do I get sudo <command>
to work?