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

"JCE cannot authenticate the provider BC" when using sshj

I am trying to use the sshj library to create an SFTP client in an existing project of my company. However if I create the SSHClient instance I get the error message: [main] INFO net.schmizz.sshj.common.SecurityUtils - Registration of Security…
Björn Böing
  • 1,662
  • 15
  • 23
0
votes
2 answers

InvalidKeySpecException while doing ssh with sshj using ppk

I am trying to ssh using sshj java library to an ec2 redhat instance with the ppk file,I am getting InvalidKeySpecException . Where as i am able to successfully ssh to other machines with same ppk. I guess i am missing some configuration in the ec2…
sadath pasha
  • 49
  • 11
0
votes
1 answer

Execution of SSH command from Java sends status code 255, but in the terminal if it works

I am trying to develop a small application that allows me to send certain commands by SSH to a remote server. If I try it from the Linux terminal or from the Windows Command Prompt it works without problems, but when I do it from my Java application…
E. Betanzos
  • 1,312
  • 1
  • 9
  • 14
0
votes
1 answer

Command from console doesn't run when launched from sshj

I launch a jar from the console and it runs fine: nohup /usr/bin/java -jar payara-micro-5.183.jar myapp.war > log.out 2>&1 & echo $! When I run the same command from a distant computer with sshj, it returns a pid but the process can't be seen in…
seinecle
  • 10,118
  • 14
  • 61
  • 120
0
votes
3 answers

Exception in thread "reader" java.lang.NoClassDefFoundError: org/bouncycastle/crypto/ec/CustomNamedCurves

I've used 'net.schmizz.sshj.SSHClient' package to connect to a server. Below is my code: public class ConnectToServer { String hostName = "10.250.176.6"; int port = 22; public ConnectToServer(String hostName, int port) { …
Doris
  • 1
  • 3
0
votes
1 answer

SSHJ: How to use StatefulSFTPClient

I'm confused... I am using com/hierynomus/sshj SFTP-lib and following code gives me ClassCastException: SSHClient ssh = new SSHClient(); //... connect etc StatefulSFTPClient client = (StatefulSFTPClient) ssh.newSFTPClient(); I need the…
Jokkeri
  • 1,001
  • 1
  • 13
  • 35
0
votes
2 answers

How to avoid duplicate file processing on SFTP

We have one java application that polls files from client FTPs at every 30 minutes interval and then do a scan of all the files and see what all files are matching with the patterns configured inside the application and based on that process the…
0
votes
1 answer

Unable to reach a settlement: issue

I'm trying to create jar for sftp. I use SSHJ (0.23.0) and everything is fine on test server, but the problem is when I try to run it on production server. Java version on my production server is 7u60. SSHJ…
0
votes
0 answers

Attempting to connect to a remote server using sshj

I am looking to connect to a remote server using sshj and execute some commands. The commands im looking to do are in order: 1. log on through putty type in username and password 2. then sudo su - oracle 3. then password again 4. then "sqlplus…
0
votes
1 answer

SSHJ is not able to connect remote Linux server throws UserAuthException: Exhausted available authentication methods

I am trying to run the following Java code using sshj :- public static void main(String[] args) throws IOException { SSHClient ssh = new SSHClient(); ssh.loadKnownHosts(); ssh.connect("host", port); try { …
Saikat
  • 14,222
  • 20
  • 104
  • 125
0
votes
1 answer

Expectit doesn't find my expected string

I'm trying to use the expectit library with sshj like so: final Session session = getSharedSession(); final Session.Command sessionCommand = session.exec(command); try (Expect expect = new ExpectBuilder() …
schneida
  • 729
  • 3
  • 11
  • 37
0
votes
1 answer

sshj or jsch, getting java.lang.NoClassDefFoundError when deployed to Wildfly 10.1

I have tried both these libraries and Wildfly is throwing java.lang.NoClassDefFoundError on any class in use when my application is deployed. Is there something in Wildfly that's blocking these libraries/or APIs that they use?
codegy
  • 118
  • 6
0
votes
1 answer

how to avoid Illegal key size warning in hierynomus ssh

i have disable the host key checking ssh but it logs illegal key size warning SSHClient ssh = new SSHClient(); ssh.addHostKeyVerifier(new HostKeyVerifier() { @Override public boolean verify(String arg0, int arg1, PublicKey arg2) { …
0
votes
1 answer

sshj: how to read InputStream from long-running command while command is executing

Currently I am executing command over ssh using: val sshCmd = session.exec(command) println(IOUtils.readFully(sshCmd.inputStream).toString()) sshCmd.join() However, to see the output I need to wait until the command is finished. How can I get…
igr
  • 10,199
  • 13
  • 65
  • 111
0
votes
1 answer

NoClassDefFoundError in 'new SSHClient.authPublickey(String ,KeyProvider)' method

I am trying to connect my localhost with classes which provided from sshj library,for educational purposes.So I wrote the code above but there is a problem at new SSHClient.authPublickey(String userName,KeyProvider... keys) method.I traced every…
Huloo
  • 3
  • 4