sudo not found

I am running AIX 4.3.3 and I have downloaded and installed (by extracting the files) the correct version.

I ran visudo and simply set it to:

someuser  ALL=(ALL) NOPASSWD:ALL

I login as someuser and I get ksh: sudo: not found.

Can anyone help?
biffsmithAsked:
Who is Participating?
 
TintinConnect With a Mentor Commented:
If you can't

ls -l /usr/local/bin/sudo

as yourself, then you will have screwed permissions on either /usr/local or /usr/local/bin, or both.

As root, do

ls -ld /usr/local
ls -ld /usr/local/bin

They should have perms of 755.
0
 
biffsmithAuthor Commented:
I should also say that I have /usr/local/bin in someuser's PATH and that's where sudo was un-tarred to on my server.  

Additionally - I can run sudo when I login as root.
0
 
Kent OlsenData Warehouse Architect / DBACommented:


Check the permissions on sudo.  Make sure it's accessible to the other user.  chmod 555 comes to mind.  :)




Kent

0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
TintinCommented:
What are the results of:

ls -l `which sudo`

or

ls -l /usr/local/bin/sudo

and

echo $PATH
0
 
biffsmithAuthor Commented:
Well - I think the problem goes deeper than sudo.  Ever since I installed it this afternoon, I now cannot run any batch programs in my someuser's directory without typing in the entire path to the batch file.

Here's the situation:  login is dsmith -- directory is /home/dsmith -- I have a script file named 1 that I usually run simply by typing 1 <enter> (because, when I log in I'm automatically in the /home/dsmith directory) and now it says /bin/ksh: 1: not found.  So - it's the same error that I was getting trying to run sudo.  My path statement obviously has my /home/dsmith directory on it so I'm sure this is a bigger problem.  

Additionally - loggin in as root and cd to /home/dsmith - I still cannot run the 1 script file without typing /home/dsmith/1.

Any thoughts?
0
 
TintinCommented:
When you login as dsmith, what is the output of

echo $PATH

root should *never* have . in the PATH, as it is a security risk.
0
 
biffsmithAuthor Commented:
Tintin:

Here's the results of echo $PATH for my login:

$ echo $PATH
/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/dsmith/bin:/usr/bin/X11:/sbin:/usr/local/bin.

Why would this start happening all of a sudden - after [trying to] install sudo?
0
 
TintinCommented:
There's your problem.

Look at the end of your PATH, you have

/usr/local/bin.

instead of

/usr/local/bin

I suspect that it used to be:

...:/usr/local/bin:.

Note the missing colon.  This would also explain why you can't run scripts in your current directory without specifying the path.
0
 
biffsmithAuthor Commented:
Tintin:

You are a genius!  The problem with running my scripts is now fixed.  However - am still getting ksh: sudo: not found when I try to run sudo as dsmith.

However - when I try to run it as root it works.  Here's the results of 'which sudo':


# which sudo
/usr/local/bin/sudo
#

Any ideas as to why I can't run sudo?  /usr/local/bin is in my path.
0
 
TintinCommented:
What does

ls -l /usr/local/bin/sudo

report?
0
 
TintinCommented:
If the perms aren't

---s--x--x

Then do

chmod 4111 /usr/local/bin/sudo

as the root user.

Also make sure it is owned by root.
0
 
biffsmithAuthor Commented:
Here are the results of ls -l /usr/local/bin/sudo.  By the way - I cannot run the ls -l command on /usr/local/bin/sudo logged in as myself -- I had to su to root.

# ls -l /usr/local/bin/sudo
---s--x--x   2 root     system    138579 Apr 03 21:09 /usr/local/bin/sudo
#

Any ideas?
0
 
Kent OlsenData Warehouse Architect / DBACommented:

Is 'sudo' a script file or executable object?

If it's a script, try commenting the first line (with several '#') so that the shell uses the default shell processor.  It may be that the script is specifying a shell that's not available on AIX.

Kent
0
 
biffsmithAuthor Commented:
Kent:

sudo is an executable as far as I know.  I downloaded the binary package for AIX 4.3.3.

Debbie
0
 
Kent OlsenData Warehouse Architect / DBACommented:

That's not conclusive.  A lot of packages run via a script.

Use od(1) or head(1) to see the top of the file.  It'll be very obvious whether it's text or binary.


Kent
0
 
biffsmithAuthor Commented:
Kent:

It's definitely binary.

Debbie
0
 
biffsmithAuthor Commented:
That was it!  Thanks, Tintin.  You are my hero for today!

Deb
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.