How to use ssh, there is a special library in python, I don't know if groovy or java has it

I have only used python to write scripts before, and the code base is relatively poor,I would like to ask you all here
How to invoke ssh, I want to do the following: connect our device (linux) via ssh, enter the command and get the result

I suppose you want to use the Linux/MacOS ssh command from a Test Case script in Katalon Studio. Then, have a look at this doc:

With this, you can execute any command line command including “ssh”.

But, this document does not cover how to consume the returned value from the subprocess. … it’s a shame. People doesn’t use this technique often in fact, so the doc is poorly written.

1 Like

You can learn about java.lang.ProcessBuilder in the following article:

java.lang.ProcessBuilder is included in the Java8 Runtime, so that you can use in any version of Katalon Studio without external dependencies.

It is, I think, a bit difficult to use ProcessBuilder which implements a lot of features. It requires certain programming effort.


Here is my code that wraps the ProcessBuilder:

This code is a mimic of Python’s Subprocess module.

thanks for sharing

The following article describes a few SSH client in java.

https://www.baeldung.com/java-ssh-connection

I haven’t tried any of them. Just FYI.

These external libraries’ jar files are not bundled in Katalon Studio. If you want to try them, you need to download the jar and locate it in the Drivers folder of your Katalon project as documented in

1 Like