You are not logged in.
Pages: 1
I have installed sudo and configured it, it was working the way I wanted it too until I restarted. After that, whenever I try and use sudo I get an error saying that saying that the program cannot be found. For example if I type sudo vi /etc/rc.conf, I get: sudo: vi: command not found. but if I do :
su && vi /etc/rc.conf, It works. Is there anyway to get my sudo working again?
Offline
export PATH=$PATH:/sbin/
Try to include the above line in .bash_profile
Offline
i did but still the same problem.
Offline
It's something with PATH. I don't know where the problem is (try googling 'sudo path'...) but what should work is running it with 'sudo -E <whatever>' (see the manpage).
Offline
Also, when I try visudo while logged in as root using su, I get :
bash: visudo: command not found
but if i run it while lgged in as root normally, it works.
Offline
Are you using:
su
or
su -
Although it should work either way. "su" by itself just changes your effective uid and not your login environment. Adding the "-" option changes your login environment. to the target user, "root" being the target user if no user is supplied.
For me both "su" and "su -" let me run visudo.
Offline
i did but still the same problem.
you will also need to source your .bash_profile so your current shell re-reads the config. Or log out and back in instead
. ~/.bash_profile
Last edited by oliver (2008-05-04 15:33:12)
Offline
Pages: 1