End SSH Session

Terminates an SSH connection.

Command availability: IBM RPA SaaS and IBM RPA on premises

Description

Terminates an SSH connection.

Script syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

closeSSH --client(SSHSession)

Input parameters

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
SSH Connection client Required SSH Session Variable containing the data of the SSH connection to be terminated.



The required variable is generated in the SSH Connection parameter of the SSH Login command.

Example

The command terminates the SSH connection initiated by the SSH Login command.

defVar --name sshConnection --type SSHSession
defVar --name sshTunnel --type SSHForwardedPort
defVar --name result --type String
// Initiates the connection to an SSH server and tunneling to the destination server.
startSSH --host "172.16.4.200" --username "User Name" --password Password --port 22 --keygen "File with private key" --passphrase "Key Phrase" --timeout 00:00:05 sshConnection=value
openSSHTunnel --client ${sshConnection} --port 80 --boundport 8090 --destination "Local" --host "192.168.0.10" sshTunnel=value
// Sending the "ls" command to the SSH server for a list of file names from the current directory of the destination server.
executeSSH --client ${sshConnection} --command ls --timeout 00:00:05 result=value
// Terminate the SSH connection.
closeSSH --client ${conexaoSSH}
// Connection to an SSH server to send commands to it is demonstrated.
//All host, port, and connection data is for example only, with both client services and SSH server installed.
// The user must enter valid data for a valid SSH connection!