HP 3PAR OS 3.1.3 CLI Administrator's Manual

5. Write your script. See the following example:
#!/bin/sh
# Assume that the user name user3 exists on system1
# The private key file id_rsa is accessible.
SSH="ssh i id_rsa l user3 system1 "
#
# Execute the command passed in as command line argument $1
${SSH} $1
6. If you specified a pass phrase when creating the key pair, run ssh-agent and ssh-add to decrypt
the key before running your script (<script_name> in the following example).
$ sshagent
echo Agent pid 24216
$ sshadd
Enter passphrase for /home/usr/user3/.ssh/id_dsa: ******
Identity added: /home/usr/user3/.ssh/id_dsa (/home/usr/user3/.ssh/id_dsa)
$ <script_name>
NOTE: You can redirect the standard input, or stdin, to execute multiple CLI commands.
SSH 63