SUMMARY: execute shell script as another user



I got a lot of responses, and thanks to everyone who did. Some of the suggestions included using except, sudo, and DOP in Tru64.

The below answer is all I needed to do. I did a ssh-keygen -r rsa from the Oracle account on the Tru64 box. It generated the keys. then I copied the key in id_rsa.pub file, to the authorized_key file on the other server. Then that Oracle user could ssh/scp to that other box with no logon prompt (ex: oracle_user# ssh scpusert@other_system )


If I am logged into my T64 box as scpuser, I can run the scp script that
automatically logs into the other box as scpuser and copies the file.

Can't you just place the remote user's ssh key files in the local Oracle
home directory, so that when the oracle user runs the script and copies
the files to/from the remote host, it has the keys?


My problem is that ultimately, scpuser wont be the one executing this
script. An Oracle account will call my script. I'd rather not have the
Oracle account be the one doing the SSH logins.

Why not? How many people have the Oracle login?


gjvc


____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping



Relevant Pages

  • Re: No one could logon to productio database for a while
    ... Puget Sound Oracle Users Group ... code for script is quite simple, it does a v$sql to find all sql ... The script ask for the hash value of the SQL statement. ... col "SLAVE SQL" format A95 WORD_WRAP ...
    (comp.databases.oracle.server)
  • Re: cant drop any user
    ... error occurred at recursive SQL level 2 ... exact fetch returns more than requested number of rows ... I want to see the entire shell script you're using to try to drop ... and you engage Oracle support. ...
    (comp.databases.oracle.server)
  • Re: Data Pump error
    ... Copyright 2003, 2005, Oracle. ... Oracle Database 10g Express Edition Release 10.2.0.1.0 - ... If I just installed Oracle Express, what is the password for SYSDBA? ... Then you can run suggested script (just paste or type the ...
    (comp.databases.oracle.tools)
  • Problem installing an Oracle patch using Perl on sunfire 3800
    ... Oracle installs fine, ... the patch script supplied by Oracle, ... waitid() ...
    (SunManagers)
  • Re: Solaris 10: cannot gracefully shutdown legacy services?
    ... Oracle starts up just fine. ... > processes with a SIGTERM. ... > Reading `man init`, I find: ... > This invokes the script, ...
    (comp.unix.solaris)