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
2
votes
1 answer

BouncyCastle is required to read a key of type ecdsa-sha2-nistp256

I'm working on a scala application with an SSH2 connection using sshj (0.19.1). I can connect fine from within eclipse, but running the application from a fat jar, I'm getting some errors. My initial error was: Line 3: TransportException: null at…
bhnat
  • 97
  • 2
  • 11
2
votes
1 answer

Java SSHJ - Add to known_hosts file in verifier

I am using SSHJ to execute a remote command, which I can successfully do when the host is in the SSH known_hosts file. However, if the host is not in this file then I would like to the the user the option to add it. I believe the way to do this is…
soarjay
  • 641
  • 4
  • 17
2
votes
2 answers

Stream the output from SSHJ or JScH

I went through the Java APIs like SSHJ and JScH for executing commands over a remote machine. I explored Java Expect API's like ExpectIt and Expect4j. But I could not find a way to stream the output line by line from the machine to my java process.…
nav3916872
  • 978
  • 13
  • 20
2
votes
1 answer

timeout at net.schmizz.sshj.transport.KeyExchanger.waitForDone(KeyExchanger.java:160)

I have a nightly job that is using net.schmizz.sshj SFTP library. I suspect that there was a change on the server that we SFTP into. However, I cannot pinpoint what the exact change is. Nor can I reproduce it outside the production server. So I am…
Kirby
  • 15,127
  • 10
  • 89
  • 104
2
votes
3 answers

issue while ssh while using sshj in java

I am trying to get a remote connection to server to execute some commands. I am new to this so started googling. After some search, I gave a try: I am using sshj0.2.3.jar. And here is how I implemented it: public static void main(String[] args)…
user234194
  • 1,683
  • 10
  • 38
  • 56
2
votes
2 answers

RSA SSH2 Private Key issue using Jsch and Sshj in Java

Here i am trying to connect to Remote Machine to do file transfer through SFTP. We are using RSA SSH2 key based authentication while connecting to remote machine. I Tried doing this in below 2 approaches, i am facing issue with both the…
Uppicharla
  • 494
  • 8
  • 18
2
votes
1 answer

JavaFX button to trigger SSHJ connection

This should be so simple, but I am not sure what I am doing wrong. I have a primitive GUI with a button. When that button get's pressed, I want to start a SSH connection. @FXML private void handleButtonAction(ActionEvent event) throws…
Marc
  • 23
  • 3
2
votes
3 answers

net.schmizz.sshj.transport.TransportException: Unable to reach a settlement

I am trying to do ssh into other machine using SSHJ. PFA code below (excluded try/catch/finally blocks). Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); final SSHClient sshClient = new…
inari6
  • 401
  • 1
  • 9
  • 19
2
votes
1 answer

Exhausted available authentication method

searched and researched but could not find answer/solution Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); SSHClient ssh = new SSHClient(); ssh.addHostKeyVerifier(new PromiscuousVerifier()); ssh.connect("aws…
user2612196
  • 109
  • 1
  • 2
  • 4
2
votes
1 answer

Executing "sudo" command on my Amazon EC2 box using sshj java library

I am trying to execute a sudo command on my Amazon EC2 machine using the SSHJ library (https://github.com/shikhar/sshj). Unfortunately, I am not getting any response from the server. I know for sure that the other non-sudo commands get executed…
systemboot
  • 860
  • 2
  • 8
  • 22
2
votes
2 answers

Sudo access while using SSHJ

I am writing a Java program that can programmatically SSH into any remote machine and execute commands. I am re-using an existing Java library to do so: https://github.com/shikhar/sshj The issue I am running into is figuring out how to sudo switch…
HiChews123
  • 1,598
  • 4
  • 20
  • 39
2
votes
1 answer

Automatically close and disconnect a java sshj session

I am using the sshj library for java. I need to open an ssh session on a remote server, execute a command which could run for many minutes, and then continue on executing in my java code. Once the command running on the remote server is finished, i…
bob smith
  • 41
  • 6
2
votes
3 answers

How to connect to a remote machine with username and password using sshj java api?

How to connect to a remote machine with username and password using sshj java api? I tried this code. What is the problem with this code? final SSHClient ssh = new SSHClient(); ssh.connect("192.168.0.1"); ssh.authPassword("abcde",…
rgksugan
  • 3,521
  • 12
  • 45
  • 53
1
vote
1 answer

Returning Shell return values using sshj

I am using sshj to connect to remote machines to retrieve various values. As I understand in sshj, when I perform the following code to retrieve the hostname of the remote machine: SSHClient sshClient = new SSHClient(); Session session =…
scottsue
  • 98
  • 1
  • 7
1
vote
0 answers

How to get filtered list of files from SFTP server using SSHJ

I am trying to get a filtered list of files from a SFTP server using SSHJ. It works fine without filter but I am not getting any example of filter. I am using list files like Map map = new HashMap(); …
Atanu Roy
  • 11
  • 3