

Command Execution › Run SSH Command Operator › Example
Example
This example explains how the Run SSH Command operator operates interactively.
Follow these steps::
- Open an SSH connection to the remote host.
- Log in non-interactively using one of the following:
- A user name and password.
- A user name and private key.
- A user name, private key, and passphrase, if the private key was created with a passphrase.
- Read from the SSH session until one of the following occurs:
- You match the pattern specified in User Command Prompt. Continue to step 4.
- The Time to Wait for Prompts expires without matching the pattern specified in User Command Prompt. Fail the operator.
- Determine whether the operator is set to Run Commands as Another User.
- If so, go to step 5.
- If not, go to step 6.
- Send the Switch User Command and read from the SSH session until one of the following occurs:
- You match the pattern specified in Switch User Password Text Prompt, which requires a password to switch users.
- You match the pattern specified in Switch User Command Prompt, which requires no password to switch users. Continue to step 6.
- The Time to Wait for Prompts expires without matching the Switch User Password Text Prompt and the Switch User Command Prompt. Fail the operator.
- The Run SSH Command operator has logged in and switched the user, if applicable. The operator is now ready to execute the commands.
- Loop through the commands, sending one command at a time, and read from the SSH session until one of the following occurs:
- You match the pattern specified in User Command Prompt, if we did not switch to another user. Repeat step 7 and send the next command.
- You match the pattern specified in Switch User Command Prompt, if we switched to another user. Repeat step 7 and send the next command.
- The Time to Wait for Prompts expires without matching the User Command Prompt or the Switch User Command Prompt (whichever is applicable). Fail the operator.
Copyright © 2014 CA.
All rights reserved.
 
|
|