System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting "command not found" after sudo upgrade

f. halili
Trusted Contributor

Getting "command not found" after sudo upgrade

Sudo was upgraded to 1.7.1. When a command is called via sudo I'm getting "command not found" now.

Sample:
$ sudo vault
Password:
sudo vault: command not found.

Please note that vault is on /opt/dba/sudo. I workaound I do now is - I run $ sudo /opt/dba/sudo/vault, it works fine.

Any thoughts?

Thanks,
f. halili
derekh
12 REPLIES
Patrick Wallek
Honored Contributor

Re: Getting "command not found" after sudo upgrade

Is /opt/dba/sudo in your PATH?

echo $PATH

If not, that is your problem. The directory needs to be part of your path.
Tingli
Esteemed Contributor

Re: Getting "command not found" after sudo upgrade

I think there are two version of sudo, one is located in /etc while the other is in /opt/dba/. You might have installed a different sudo. What I did is put a link in /etc to make it work.
Bijeesh
Respected Contributor

Re: Getting "command not found" after sudo upgrade

hi

since it is working after giving full pathname
the problem may be due to the $PATH.
Add /opt/dba/sudo to your PATH variable.
f. halili
Trusted Contributor

Re: Getting "command not found" after sudo upgrade

This "sudo vault" is for the data center users that we have. In the /opt/sudo/etc/sudoers file, the

"Cmnd_Alias NETBKUP /opt/dba/sudo/vault"

is defined. Adding /opt/dba/sudo to the PATH seems to open up that directory?

Thanks,
f.halili
derekh
Patrick Wallek
Honored Contributor

Re: Getting "command not found" after sudo upgrade

>> Adding /opt/dba/sudo to the PATH seems to open up that directory?

How so? If the users require sudo to execute anything from that directory, what is the problem?

Having the full path to the command in sudoers does NOT mean that you only have to type the command name. Sudoers tells sudo what users are authorized to use. The system still has to be able to get to the command.

f. halili
Trusted Contributor

Re: Getting "command not found" after sudo upgrade

The "/opt/dba/sudo" is in the PATH, and has not changed. So when I was working with the user ealier, we are getting the error even with the PATH defined.

Below is the echo $PATH of the user who will the running the 'sudo '

echo $PATH
/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/ipf/bin:/opt/nettladm/bin:/opt/fcms/bin:/opt/ssh/bin:/usr/bin/X11:/opt/sec_mgmt/bastille/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/resmon/bin:/opt/gnome/bin:/usr/contrib/kwdb/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/graphics/common/bin:/opt/sec_mgmt/spc/bin:/usr/sbin/diag/contrib:/opt/hpsmh/bin:/opt/upgrade/bin:/opt/mx/bin:/opt/perf/bin:/opt/ignite/bin:/usr/local/bin:/opt/binutils/bin:/opt/zip/bin:/opt/sudo/bin:/opt/gtar/bin:/opt/gfind/bin:/opt/dba/bin:/opt/vim/bin:/opt/ssh/bin:/opt/mozilla:/usr/contrib/bin/X11:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd:/usr/openv/volmgr/bin:/opt/dazel35/bin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/oracle/product/9.2.0/bin:/opt/java/bin:/opt/dazel35/bin:/opt/dba/bin:/opt/dlc91e/bin:/opt/dba/sudo:.


Thanks,
f. halili
derekh
Patrick Wallek
Honored Contributor

Re: Getting "command not found" after sudo upgrade

Perhaps try putting /opt/dba/sudo at the beginning of the PATH variable and see if that helps.

I do not recall if there is a maximum length for the PATH, but this would be a good test.
Tingli
Esteemed Contributor

Re: Getting "command not found" after sudo upgrade

Is there a real sudo in /opt/dba/?
f. halili
Trusted Contributor

Re: Getting "command not found" after sudo upgrade

Hi Patrick,
I tried putting /opt/dba/sudo at the start of the PATH and still got the same result.


Hi Tingli,
The /optdba/sudo is a directory, and there is no real sudo there as well.

Thanks,
f. halili
derekh
John Dvorchak
Honored Contributor

Re: Getting "command not found" after sudo upgrade

Have the user type sudo -l (that is a - ell)to see what commands he can run. Then have him type the command verbatim! If the sudoers file has the full path then he must enter the full path in the sudo command.

$sudo -l
User xxxx may run the following commands on this host:
(root) NOPASSWD: /bin/rlogin *, /bin/rsh *,

for example then the user would have to run:

$sudo /bin/rlogin whateversystem
If it has wheels or a skirt, you can't afford it.
G V R Shankar
Valued Contributor

Re: Getting "command not found" after sudo upgrade

Hi,

Please relogin to the system after you have updated the PATH variable.

OR

export PATH=$PATH:/opt/dba/sudo:.

check executing the command.

Ravi.
f. halili
Trusted Contributor

Re: Getting "command not found" after sudo upgrade

thanks all.
derekh