execute shell script as another user

From: Rich Glazier (rglazier2002@yahoo.com)
Date: Thu Dec 13 2007 - 14:29:36 EST


sort of OT

Here's the situation:

I have a simple scp script (ksh) that copies a single file from one Tru64 machine to another, as a particular account. The keys have already been generated and placed in eachothers authorized_keys files for that particular user, so the scp executes with no login prompt, while logged in as that user.

The scpuser account I created is a specific locked down account for just that secure copy.

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.

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.

Is there a way for the shell script to drop to another user, or subshell as another user, or something like that? Just adding a "su - scpuser" to the script is going to prompt for a password.

Thanks for the help.

      ____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs

      ____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:50:36 EDT