The package contains three custom activities that facilitate establishing an SSH connection (SSHConnectScopeActivity) and sending commands to an already opened connection (SSHRunCommandActivity & SSHRunShellCommandActivity).
Please note that SSHRunCommandActivity does not use a SSH Shell, so the context is not maintained betweent he commands. To maintain the session, you should utilize SSHRunShellCommandActivity
The package wraps the basic functionalities of the SSH.NET library https://www.nuget.org/packages/SSH.NET/. The output of the commands being sent is captured so that the developer can make use of it in the automation process.
In the automation process, the Robots need to interact with remote systems such as UNIX servers. Though sometimes achievable through UI interaction in graphical interface sharing protocols, this might not be the fastest or reliable way of working with the remote systems. In the UNIX world, SSH is the preferred network protocol for accessing such remote systems and the present activities allow unlock the full communication potential of the SSH protocol in the automation processes.
This version is not backwards compatible with the previous one! If you update to this, you will have to make some changes in the workflows that are using those activities!
Changes from the previous version:
- I've added support for sending commands over a SSH Shell which allows to maintain the context and session between commands.
- The above addition means that certain prompts need to be expected to know when the command is finished and the shell is again available for commands. Those can be described using Regex, depeding on the target SSH server. For example: "[a-zA-Z0-9_.-]*@[a-zA-Z0-9_.-]*:\~.*\$ $"
- There are 2 timeouts: SSH Timeout is the time to wait for a response from the SSH connection and the Timeout is the overall timeout of the activity, including the SSH Timeout.
- SSHRunShellCommand has it's own expected prompt property, as it can be different depending on what commands you are executing, so please consider using it if needed. By default, it will inherit the one from the SSH Connect Scope
- SSHRunShellCommand has a Check Exit Code property which will check if the result of the last command is 0. If not, it will throw an exception.