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

Transfer file from SFTP to ADLS

We are currently in the process of exploring the sshj library to download a file from SFTP path into ADLS. We are using the example as reference. We have already configured the ADLS Gen2 storage in Databricks to be accessed as an abfss URL. We are…
rainingdistros
  • 450
  • 3
  • 11
1
vote
0 answers

NoClassDefFoundError PKCS8EncodedKeySpec when running in Tomcat

I use com.hieronymus:sshj in version 0.31.0 to establish an ssh connection between a Spring Boot application and a data exchange server. To authenticate the application a private SSH key is used, generated by the default settings of ssh-keygen,…
Joshua
  • 2,932
  • 2
  • 24
  • 40
1
vote
1 answer

Java SSHJ library and enabling logging

Below is a example section of my java 1.8 program. It appears to be failing when trying to authenticate. It goes through a number of authentication methods and then declares its run out. I would like to see debug information from within the sshj…
1
vote
0 answers

How to SFTP in Java (when SSH is disabled)

My company has disabled SSH, but allows SFTP. For example, "sftp" commands will work but "ssh" will not. They may have configured something like this in "/etc/ssh/sshd_config": Match Group sftp-only ForceCommand internal-sftp …
mvanle
  • 1,847
  • 23
  • 19
1
vote
0 answers

SSHJ host fingerprint verification with multiple keys

We are connecting via ssh to a remote host from java with the sshj library. To do so we have configured a single fingerprint that is used during host verification. After some time we started to get random host key verification errors. Out of…
Krever
  • 1,371
  • 1
  • 13
  • 32
1
vote
1 answer

NoClassDefFoundError: org/bouncycastle/openssl/PEMParser when using SSHJ on Jenkins

I'm using SSHJ to execute commands on a remote server, connecting like so: private static void connect() { try { client = new SSHClient(); client.addHostKeyVerifier(new PromiscuousVerifier()); client.connect(HOST); …
csinco23
  • 21
  • 1
  • 3
1
vote
0 answers

Error during opening file: java.lang.ArrayIndexOutOfBoundsException: arraycopy: destination index -4 out of bounds for byte[256]

During opening the file in this way: RemoteFile remoteFile = sftpClient.open(path) I've faced with following error with stacktrace: java.lang.ArrayIndexOutOfBoundsException: arraycopy: destination index -4 out of bounds for byte[256] at…
Taras Melnyk
  • 3,057
  • 3
  • 38
  • 34
1
vote
0 answers

Configuration of Liferay logging system for logs from external library which use slf4j

I'm using library sshj. This library use slf4j for logs, but Liferay based on log4j. How to configure Liferay project for print logs from sshj. EDIT: My problem is not a slf4j in my liferay portlet. But library, which I'm using, working on slf4j.…
standart5
  • 31
  • 4
1
vote
0 answers

Download file from SFTP using SSHJ and put in project classpath and allow MSSQLServeContainer to load it

am working with docker to run my DAO unit test which hits the SQLServer database which resides in the docker container. STEP1: i want me to pull the latest BAK file from my remote server(Linux box in which the docker was installed) to my project…
Pradeep
  • 1,192
  • 2
  • 12
  • 30
1
vote
1 answer

SSHJ: exec hangs or loses data

I have used Trilead and Jsch to use as a SSH client for Hg, and now I'm trying it with SSHJ because it seems to provide more modern key support. The sketched code reads as SSHClient client = createClientAndAuthenticate(); Session session =…
Thomas S.
  • 5,804
  • 5
  • 37
  • 72
1
vote
2 answers

How to implement bouncycastle into one-jar?

I'm using SSHJ-library in a project. SSHJ library utilized the bouncycastle crypto. In eclipse all is good but after I use one-jar to package all in single jar package, I'm facing issues with the bouncycastle lib. The bcprov-jdk15on-1.51.jar is…
Jokkeri
  • 1,001
  • 1
  • 13
  • 35
1
vote
1 answer

How to echo a string to SSH using JAVA

I am trying to execute a remote query over SSH using pubic key/private key based authentication. Following command works fine and gives me the required output as a string on a bash shell after sharing the public keys between local host and the…
Dileep
  • 29
  • 3
1
vote
0 answers

SSHJ - command is truncated to 260 symbols

i am using sshj library in my implementation. I am connecting to the Windows box and OpenSSH is installed there. Than i am sending command like: C:\folder1\folder2\aa.bat arguments 1 2 3 and so on But execution fails.The whole length of my command…
rholdberh
  • 475
  • 1
  • 5
  • 19
1
vote
1 answer

Connecting to Google Compute Engine instance using SSHJ

I created an instance in the Google Compute Engine and I need connect using SSHJ, but I'm not getting. I can connect successfully using the AWS: public String exec(String host, String keyPair, String script) throws IOException{ File keyPairFile…
Tiago Rolim
  • 65
  • 1
  • 11
1
vote
1 answer

SSHJ+ExpectIt: Unable to send multiple commands

I'm using SSHJ and ExpectIt to send multiple commands to a virtual machine hosted on Amazon's EC2. I get no errors, but ExpectIt executes only the first command and forgets the rest. Can you find out what am I doing wrong here? { SSHClient ssh=new…
Mayukh Nair
  • 623
  • 1
  • 6
  • 26