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

Netbeans automatically cloning my jar based packages with their empty 'name equivalents'

I'm new at java programming so i just wanted to try something with ssh understand how it works and so i downloaded a java library which is mentioned in this Stack Overflow answer . After a lot of failed attempts on importing this library into…
Huloo
  • 3
  • 4
0
votes
1 answer

Application won't exit after downloading a file with scala-ssh

I'm using scala-ssh 0.7.0 to download a file from a remote server. The download itself seems to be successful (I can find the downloaded file). Here is the last part of the log output: 16:14:43.824 [main] TRACE …
Barak BN
  • 442
  • 6
  • 14
0
votes
1 answer

SCP (using sshj) from remote HP-UX (Unix) server to local file system

I want to perform a remote copy of data from a remote HP-UX server to my local file system using the sshj library. The data on this remote server has the form: DATA_.dat. For…
Kasa
  • 189
  • 2
  • 13
0
votes
1 answer

SSH with Command and File in Java

I'd like to run SSH within Java but I haven't figured out how to run an SSH statement that includes a command and file. The command for example in a standard terminal: ssh user@host 'upload' < myfile.txt Hopefully via a Java library, not some type…
blink-fish
  • 171
  • 17
0
votes
1 answer

sshj, read InputStream from long-running command

I want to read from stdout of long-running command. There is a program, which sends me some output and I have to send some response. The problem is that nothing is arriving to inputstream. What am I doing, is exec'ing command, take InputStream from…
bgnfu7re
  • 144
  • 6
0
votes
1 answer

Sending Multiple Commands to device Through SSH

I am attempting to send multiple commands to a device using the SSHJ library. There is the option of sending multiple commands in this format: Command command = sshSession.exec("show line; show ip interface brief;"); This works, but it is not…
Dagnarus
  • 65
  • 2
  • 7
0
votes
1 answer

Send an SFTP command by using runtime.exec

I would like to download a file from an sftp server by using the class Runtime of Java. I can't use a library like Jsch or SSHJ because i need to use the -B option to increase the buffer size. I've tried with this code so far: public void…
Clepshydre
  • 73
  • 1
  • 6
0
votes
0 answers

Java: start a process on a remote machine via sshj, continue with programm and stop process afterwards (dstat)

I'm trying to run dstat on a remote machine via ssh from my Java program using the sshj library. import net.schmizz.sshj.connection.channel.direct.Session; import net.schmizz.sshj.connection.channel.direct.Session.Command; What I need to do is…
0
votes
1 answer

Remote connect using SSHJ in a Maven shade jar

I have used SSHJ to connect to a remote machine and that works fine when doing it from IntelliJIDEA. However when I try to build an "uberjar" using maven-shade-plugin I get the stacktrace shown below. I do have org.bouncycastle.bcprov-jdk16 in the…
keyoxy
  • 4,423
  • 2
  • 21
  • 18
0
votes
1 answer

sshj 0.9.0 throwing NoClassDefFoundError: net/schmizz/sshj/SSHClient

My code below is throwing following Error and only information i can find on Google involved logging errors but nothing that looks like mine. I have tried installing dependences it says are needed on the central maven repo but still the problem…
0
votes
1 answer

How to use sshj to tunnel through an intermediate server without using local port forward

I am trying to use sshj to tunnel through an gateway (jump point) server: A -> B -> C The caveat is that I need to do this without setting up a local port forward. I need to make a direct connection to server B, then make another ssh connection to…
Scott
  • 16,711
  • 14
  • 75
  • 120
0
votes
1 answer

sshj exec not displaying results the way I expected

Im trying to SSH from Java to a server and run multiple commands. the commands seem to work ok but I am not getting the results back in Java that I wanted. Here is my code snippet final Command cmd = session.exec("cd /app/t/backo/bin && ls…
ducati1212
  • 855
  • 9
  • 18
  • 29
-1
votes
1 answer

chmod method in SFTPClient of sshj-0.27.0.jar is corrupting the file permissions

I am trying to change the permission of a file to 555 using the SFTPClient.chmod method and this seems to be corrupting the file permissions. For eg. the file permission before the execution of this method was "-rw-r--r--" and after the execution is…
1 2 3 4 5 6 7
8