Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: sudo in script -- automate with password

RE: sudo in script -- automate with password

From: Reidy, Ron <Ron.Reidy_at_arraybiopharma.com>
Date: 2006-01-04 22:16:21
Message-id: 17CAB0BF27BCFC47B0E4554A0E2F962B562C7F@fiji.arraybp.com


Programs such as sudo, passwd, etc. that prompt for a password (not sqlplus) do not take those passwords from the command line. This means that you cannot use a here-document for these types of activities. Instead, you will need to control the tty device. The only way I know to do this is to use the expect utility or the Perl Expect module.

However, this will mean you will need to hard-code the password into your shell script. If this is something you do not want or cannot do, then you will have to create an entry in the sudoers file to allow the command to be executed without a password.

--

Ron Reidy
Lead DBA
Array BioPharma, Inc.

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of J. Dex Sent: Wednesday, January 04, 2006 2:04 PM To: oracle-l_at_freelists.org
Subject: sudo in script -- automate with password

I have got a database script that mid-way through the script it needs to log
in as sudo and run a process. The problem is the sudo password. I can't
figure out a way to put it in the script instead of manually having to enter
it. Pulling the password from a password file doesn't seem to work either.
Has anyone else found a solution to this or needed to do this? The OS is
AIX and it is Oracle 9202. Is there a special syntax that needs to be used?



Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/

--

http://www.freelists.org/webpage/oracle-l

This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.

--

http://www.freelists.org/webpage/oracle-l Received on Wed Jan 04 2006 - 22:16:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US