Introduction
The ATS SSH client allows you to execute remote commands over the SSH protocol
Simple example
Here is a basic example of how you can create a SSH client and execute a command.
After its completion, you can get the exit code and the output to evaluate the command result.
import com.axway.ats.action.ssh.SshClient; // make an instance of the SSH client by specifying host and user credentials SshClient sshClient = new SshClient( SERVER_IP, USER_NAME, USER_PASSWORD ); // execute some SSH command sshClient.execute( <SOME COMMAND> ); // check the command result using the following methods int exitCode = sshClient.getCommandExitCode(); String standardOutput = sshClient.getStandardOutput(); String errorOutput = sshClient.getErrorOutput(); // disconnect the SSH connection sshClient.close();
Back to parent page
Go to Table of Contents