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
19
votes
5 answers

Dealing with "[HOST_KEY_NOT_VERIFIABLE] Could not verify `ssh-rsa` host key with fingerprint" in sshj

I having a strange issue with sshj (am using sshj v0.6.0) for which I would need some help from someone. Authentication with public key works fine on some machines but doesnt work fine on other machines and I see the below error. The only difference…
Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66
14
votes
2 answers

SSHJ Example of Public Key Auth from File

Can someone give me an example of using SSHJ for Public Key Authentication? I realise this question is essentially identical to ssh example of private/public key authentication, however the answer by the author…
Obiphil
  • 361
  • 1
  • 6
  • 17
12
votes
3 answers

execute sequense of commands in sshj

I need to execute some sequence of commands at the remote server via ssh, using sshj library. I do Session session = ssh.startSession(); Session.Command cmd = session.exec("ls -l"); …
NullPointer
  • 924
  • 14
  • 27
11
votes
3 answers

"Could not load known_hosts" exception using SSHJ

I am getting an exception while using SSHJ. Here is how I implemented it: public static void main(String[] args) throws IOException { // TODO Auto-generated method stub final SSHClient ssh = new SSHClient(); ssh.loadKnownHosts(); …
user234194
  • 1,683
  • 10
  • 38
  • 56
10
votes
1 answer

Streaming remote files into file objects

If anyone knows a quick way how to get a remote file directly streaming into a file object, so it isn't necessary to store the file temporary on a computer it would be greatly appreciated! Until now I copy the file from a remote ios-device as…
Blizzer
  • 260
  • 4
  • 22
8
votes
2 answers

ssh example of private/public key authentication

Can anyone give me an example of private/public key authentication in sshj? In sshj what's the command line equivalent of, ssh -i /path/to/mykey.private username@host I tried (error handling omitted), final SSHClient ssh = new…
Everett Toews
  • 10,337
  • 10
  • 44
  • 45
8
votes
6 answers

Android SSHJ exception upon connect() - "KeyFactory ECDSA implementation not found"

I'm trying to open an SSH client session from my Android app. Trying to connect to a device on the local network (a Raspberry Pi). I'm using the SSHJ library version 0.10.0. It fails on the ssh.connect() call, with a TransportException which is…
dodgy_coder
  • 12,407
  • 10
  • 54
  • 67
7
votes
1 answer

start with sshj

I want to create a Java application to connect to my remote Linux server with ssh. Can someone send me some docs or tutorials to begin with sshj in eclipse (I'm working in a Windows environment).
Dark_angel
  • 109
  • 1
  • 2
  • 9
6
votes
3 answers

SSHJ - Keypair login to EC2 instance

I have a pem file that looks like the one in SSHJ tests (though I don't see it being referenced): https://github.com/shikhar/sshj/blob/master/src/test/resources/hostkey.pem . Simply trying to auth in via the pem file to an EC2 instance (read as…
user375566
6
votes
1 answer

how can I modify net.schmizz.sshj logging level?

Can I change the level of logger for the default config or disable it for sshj library my code so far [ Config config = new DefaultConfig(); config.setKeepAliveProvider(KeepAliveProvider.KEEP_ALIVE); SSHClient sshClient = new…
AhMaD AbUIeSa
  • 805
  • 1
  • 12
  • 21
6
votes
0 answers

SSHJ trying to start a session results in SSH_MSG_UNIMPLEMENTED

I'm on a Windows machine, and I need to write some Java code that connects to a remote Solaris machine by using SSH and can then execute commands on it and get their output, but I'm having some trouble authenticating. (I'm using SSHJ 0.8.1) Here's…
kjerins
  • 403
  • 1
  • 4
  • 19
6
votes
1 answer

What is the signification of -f in scp command?

I'm using the library sshj for sending an scp command. It uses the option -f for downloading from a server to another. I can't find the -f option in the man. What is the signification of -f in an scp command?
Clepshydre
  • 73
  • 1
  • 6
6
votes
2 answers

net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods

first time asking on stackoverflow, and also using sshj. Besides the examples provided with sshj, I haven't really found any good resources to help using this API. I've been trying to do remote port forwarding using sshj and have run into this…
user2243685
  • 61
  • 1
  • 1
  • 3
5
votes
4 answers

Killing a process through sshj

Im using sshj and im trying to tail a file, but my problem is that the remote process is never killed. In the following example code you can see that i try to tail /var/log/syslog, and then i send a kill signal to the process. However after the…
netbrain
  • 9,194
  • 6
  • 42
  • 68
5
votes
2 answers

Jsch or SSHJ or Ganymed SSH-2?

I need to connect to server(username,pasw,host)-- easy enter 3-10 commands -- command="dir;date;cd;dir" is there an easier way ?, without writing 20 lines: while(smtng) { a lot of stuff+ mysterious print to scr:D } download a file-- easy write…
user605596
  • 259
  • 2
  • 3
  • 7
1
2 3 4 5 6 7 8