Description
jcabi-ssh is a Java library for running commands on remote machines over SSH. It is an object-oriented wrapper around JSch, the Java SSH library. You create an SSH object with a host, port, login and key, wrap it in a Shell, and run a command such as echo or uptime to get its output back as text. The library also includes an SSHD class that starts a small SSH daemon, which you can use in unit tests without a real server. The only dependency you need is jcabi-ssh itself, and you can add it to a project with a Maven dependency or download the jar and put it on the classpath. The current release on the project site is 1.9.0, dated 26 September 2022. The site also describes how to use the 2.0-SNAPSHOT version from the snapshot repository if you want unreleased changes. The site has a release history, JavaDoc and a project team page, and the code is hosted on GitHub. It is for Java developers who need to run commands on remote hosts from their own code.…
Highlights
- Run remote commands over SSH from Java
- Object-oriented wrapper around JSch
- Built-in SSHD server for unit tests
- Maven dependency or plain jar
Ratings & Reviews
No ratings yet
Be the first to rate Jcabi SSH.
People also visit
Jcabi SSH FAQ
What is jcabi-ssh?
It is a Java library that runs commands on remote servers over SSH. It wraps JSch in simpler, object-oriented classes.
How do I install it?
Add the Maven dependency com.jcabi jcabi-ssh with version 1.9.0, or download the jar from the project site and add it to your classpath.
How do I run a command on a remote host?
Create an SSH object with the host, port, username and key, then pass it to a Shell.Plain and call exec with the command. The output comes back as a string.
Does it include a test server?
Yes. The SSHD class starts a small SSH daemon that you can use in unit tests.
What are the best Jcabi SSH alternatives?
Popular alternatives to Jcabi SSH include Sshj, Goto and WebSSH. See all Jcabi SSH alternatives

