1833883 Members
1693 Online
110063 Solutions
New Discussion

switch user...

 
SOLVED
Go to solution
Bing Wong
Frequent Advisor

switch user...

I created a regular user called "reguser" and allowed it execute Oracle utilities.

When I logged on using that account and executed the following command, I received password prompt to enter Oracle password. Oracle account is an UNIX account. How can I enable this regular user to switch user to Oracle and not required to enter Oracle password? Your help is always appreciated.

su - oracle - c "/app/db/oracle/u01/oracle/product/9.2.0.1.0/bin/sqlplus /nolog"
4 REPLIES 4
John Guster
Trusted Contributor
Solution

Re: switch user...

su must combine with appropriate password except current user is root. You might want set up sudo for this regular account to execute this command.
James R. Ferguson
Acclaimed Contributor

Re: switch user...

Hi Bing:

A non-root user that attempts to use 'su - otheruser' to switch accounts will always be prompted, interactively, for the 'otheruser' password. You can't even redirect a file containing the 'otheruser' password to 'su' to circumvent this.

You will have to find a different approach -- 'sudo' or a C-setuid script wrapper are two approaches.

Regards!

...JRF...
Bing Wong
Frequent Advisor

Re: switch user...

I will explore your solutions.

Thank you James and John.
Bing Wong
Frequent Advisor

Re: switch user...

I will explore your solutions.

Thank you James and John!