Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH Java-library for Android? [closed]

Tags:

I'm trying to create an app for Android that simply sends a command to an SSH server. No response needed, I just need to be able to send a command. I was wondering if there's any java library out there that I could use?

No advanced stuff needed, just a pure connection to send the command.

like image 242
Joakim Berglund Avatar asked Aug 12 '09 21:08

Joakim Berglund


People also ask

Can I use Java libraries in Android?

To use a Java library (JAR file) inside your Android project, you can simple copy the JAR file into the folder called libs in your application. *. jar files in this folder are included into the compile classpath via the default build.

How do I SSH into Java code?

An execution of a shell command via SSH can be done in Java, in just a few lines, using jcabi-ssh: String hello = new Shell. Plain( new SSH( "ssh.example.com", 22, "yegor", "-----BEGIN RSA PRIVATE KEY-----..." ) ).

Can you SSH with Java?

JSch is the Java implementation of SSH2 that allows us to connect to an SSH server and use port forwarding, X11 forwarding, and file transfer. Also, it is licensed under the BSD style license and provides us with an easy way to establish an SSH connection with Java.


1 Answers

You are searching for JSch.

Other libs are jaramiko, paramiko, trilead-ssh2 . A place where you can browse the source for trilead is the connectbot project. Please notice that connectbot also uses this unmaintained lib.

It also exists a commercial SSH Java lib: J2SSH Maverick

Note: Answer refactored due to comment.

like image 99
tuergeist Avatar answered Sep 23 '22 14:09

tuergeist