Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guybedo/sshtools
Java SSH tools - easier SSH & SFTP in Java
https://github.com/guybedo/sshtools
java java-8 sftp sftp-client ssh ssh-client
Last synced: 4 days ago
JSON representation
Java SSH tools - easier SSH & SFTP in Java
- Host: GitHub
- URL: https://github.com/guybedo/sshtools
- Owner: guybedo
- Created: 2019-01-31T17:43:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-18T00:52:54.000Z (about 2 months ago)
- Last Synced: 2024-09-18T04:42:29.265Z (about 2 months ago)
- Topics: java, java-8, sftp, sftp-client, ssh, ssh-client
- Language: Java
- Size: 73.2 KB
- Stars: 24
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
sshtools
--------Java SSH tools - easier SSH & SFTP in Java
Sshtools is a wrapper around http://www.jcraft.com/jsch/.
The goal is to make it easier to do SSH & SFTP in Java, as using Jsch can be tricky.
Getting Started
---------------Maven
-----```xml
com.akalea
ssh-tools
0.2.0```
Usage
-----**Setup your SSH connection**:
```java
SshServerInfo serverInfo =
new SshServerInfo(
"login",
"localhost",
"/home/user/.ssh/id_rsa",
null);
```**Delete a file**:
```java
Ssh
.of(serverInfo)
.file()
.deleteFile("/home/user/test.txt");
```**Execute shell commands**:
```java
Ssh
.of(serverInfo)
.command()
.execute(commands);
```**SFTP**:
```java
Ssh
.of(serverInfo)
.sftp()
.execute(
Lists.newArrayList(
SftpCommand.put(localFile, remoteFile),
SftpCommand.get(remoteFile, downloadedFile)));
```**OTHER EXAMPLES**:
You can find examples here: [Examples](http://github.com/guybedo/sshtools/tree/master/src/main/java/com/akalea/sshtools/example)