Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird problem with su

Status
Not open for further replies.

Chapter11

Technical User
Apr 15, 2002
791
US
I am no longer able to use su to another user to run scripts.

[tt]su - oracle -c dbshut[/tt] fails with "ksh: ls: 0403-006 Execute permission denied."

[tt]su - [any_user] -c [any program][/tt] all fail with that same error.

I'm at a loss as to what's causing this, does anyone else have any ideas?

I had to rework part of oracle's .profile to handle non-interactive logins, but it also fails with the same error if I remove oracle's .profile, and it also fails for any user, any command.
 
Chapter11, sorry if this is stating the obvious, but you are putting quotes around your command?
 
Another stating the obvious question (sorry): After changing oracle's .profile, is there enough in the profile that the correct environment is set and the script can find the dbshut command? What is the ownership and permissions of dbshut? Are the databases listed in your /etc/oratab file?
 
The problem is not unique to oracle and dbshut. I cannot do this for any user, any command.

[tt]su - collins -c "ls -al"[/tt]

also fails with the same error. Any userid, any command I try, all fail.

So it isn't a problem with Oracle, dbshut, PATH, or oratab.
 
Check the permisssion of /usr/bin/su. It should be 4555.Also check the /etc/security/user and the default should be su=true.
 
put the "-c" within the quotes as well...

su - sam "-c ls -la"

try that out.
 
It appears to have cleared up on its own. I guarantee I did nothing.

I'm checking the phase of the moon.
 
I hate those kind of problems, especially if `last` only has my userid during the problem. Please post back if you find the issue. IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top