Questions tagged [sshj]

SSHJ is an SSH Client library written in Java.

SSHJ is an SSH Client library written in Java. Its homepage is https://github.com/hierynomus/sshj/ and it is Apache 2.0 licensed.

The sourcecode is hosted publicly at https://github.com/hierynomus/sshj

118 questions
1
vote
1 answer

How do I make SSHJ initiate outbound SFTP on a non-standard port?

I'm doing this and it works fine but I'd like to be able to hit an sshd on a port other than 22. final SSHClient ssh = new SSHClient(); ssh.addHostKeyVerifier( SFTP_KEY_FINGERPRINT ); ssh.connect( SFTP_SERVER_HOSTNAME ); try { …
Andrew
  • 1,031
  • 10
  • 24
1
vote
2 answers

Android sshj sending multiple commands, getting an error

I'm trying to send continious commands to raspi from my android phone. I've used the code from this link but I'm getting an…
Boreddo
  • 83
  • 1
  • 9
1
vote
1 answer

SSHJ How change current user with command su ?

I use sshj library for communication with linux from my Java app. And I need change user with command: su SSHClient ssh = new SSHClient(); ssh.connect(host); ssh.authPassword(login, password); Session s = ssh.startSession(); Command cmd =…
Sprinter
  • 717
  • 5
  • 11
1
vote
1 answer

How do I convert linux pseudo terminal output in Java?

I want to connect to an Amazon EC2 terminal via JAVA API and perform sudo operations. I ended up using SSHJ library because I found its interface very simple and easy to use. The nice thing is that I can even execute sudo operations via this…
systemboot
  • 860
  • 2
  • 8
  • 22
1
vote
3 answers

SSHJ and the Maven shade plugin

Testing SSHJ in Eclipse and everything looks good. But When I use the Maven shade plugin to package SSHJ I get the following error: Exception in thread "main" net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods at…
Anders S
  • 438
  • 4
  • 15
1
vote
1 answer

jclouds publickey auth failed - exhausted available authentication methods

I've been following the instructions the jcloud example https://github.com/jclouds/jclouds-examples/tree/master/compute-basics. I installed maven, and the program. I see VMs get created on Amazon, but the "echo hello" test at the end of the add node…
1
vote
1 answer

sqlplus missing output when using Java SSH API

I have a shell script (bash) that executes a sqlplus command, and it works perfectly when I run it from a terminal (or SSH clients like PuTTY or Xshell), what means I can read its output. Now I created a web interface where the user can start this…
1
vote
1 answer

Connecting to and AWS EC2 instance using SSHJ

I am having lots of problems with this. I have the following code try { final SSHClient ssh = new SSHClient(); PKCS8KeyFile keyFile = new PKCS8KeyFile(); keyFile.init(new…
1
vote
1 answer

How can I get an 'input prompt' when reading from an sshj inputstream?

I'm trying to write a ssh application for android using sshj. I can connect to a server and read from the inputstream without problems, getting something like: Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0.29-generic x86_64) Documentation:…
Murgi
  • 31
  • 5
1
vote
0 answers

SSHJ and multiple threads

I have a question about SSHJ and multiple threads. I have a class that uses SSHJ to execute commands on a remote server using the SSHJ SSHExec class and it is an extension of Threads. I am doing this because some of the remote commands can take a…
user1524133
  • 191
  • 5
0
votes
3 answers

How to keep SSH connection available?

I'm writing an application which uses sshj library for SSH connections. User opens Connect Dialog from menu, types login data and clicks Connect button to establish a connection. Then the user performs various operations from different panels and…
Radek Wyroslak
  • 740
  • 4
  • 7
  • 19
0
votes
1 answer

Running scripts in remote server using Rundeck 4.10

I have Rundeck community version 4.10. I have some remote nodes where the job will run some scripts on remoe node to start applications. I used SSHJ-SSH configuration for my project under Rundeck forDefault Node Executor and Default File…
Vanaan
  • 13
  • 6
0
votes
1 answer

Java sshj libary, create file onto sftp linux server without an actual file

The software I am working with has net.schmizz.sshj jars as part of it. I am trying to use the same to write a csv bytestring into a csv file on an SFTP server I have searched quite a bit but not able to find a method in this library which can take…
user3008362
  • 51
  • 1
  • 5
0
votes
0 answers

SSH Multiplexing in Java

I'm implementing an application that creates SSH connections and port forwards in those connections. A use case is that exactly the same connection; same host, same port, same forwards is requested again at a later point in time. Researching this, I…
cjsd
  • 1
  • 1
0
votes
0 answers

SSHJ Java Library - set cipher suit for SFTP connection

We are using SSHJ library for connecting to SFTP server using SSHv2. While connecting to the server we get below Negotiated algorithms: net.schmizz.sshj.transport.KeyExchanger:234 - Negotiated algorithms: [ kex=diffie-hellman-group-exchange-sha256;…
Nilesh
  • 2,054
  • 3
  • 23
  • 43