The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 09-11-2007
porter porter is offline
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Try this

script starts as X

script then does SSH to other system as Y using private key as follows...

Code:
echo this is running as X here
ssh -i identity Y@other <<EOF
echo this script part will run as Y on the other machine
EOF
echo this is back running as X here
Reply With Quote