You are not logged in.

#1 2008-05-04 11:28:38

MONODA
Member
Registered: 2008-02-09
Posts: 256

some problems with sudo

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

#2 2008-05-04 11:38:40

ProzacR
Member
Registered: 2007-04-29
Posts: 272

Re: some problems with sudo

export PATH=$PATH:/sbin/

Try to include the above line in .bash_profile

Offline

#3 2008-05-04 11:56:23

MONODA
Member
Registered: 2008-02-09
Posts: 256

Re: some problems with sudo

i did but still the same problem.

Offline

#4 2008-05-04 12:01:28

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: some problems with sudo

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

#5 2008-05-04 12:15:41

MONODA
Member
Registered: 2008-02-09
Posts: 256

Re: some problems with sudo

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

#6 2008-05-04 12:25:50

dschauer
Member
Registered: 2008-02-28
Posts: 95

Re: some problems with sudo

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

#7 2008-05-04 15:32:48

oliver
Member
Registered: 2007-12-12
Posts: 448

Re: some problems with sudo

MONODA wrote:

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

Board footer

Powered by FluxBB