Questions tagged [jsch]

JSch is a pure Java implementation of SSH2. JSch allows you to connect to an SSH server and use port forwarding, X11 forwarding, file transfer, etc., and you can integrate its functionality into your own Java programs.

JSch is a pure Java implementation of SSH2. JSch allows you to connect to an SSH server and use port forwarding, X11 forwarding, file transfer, etc., and you can integrate its functionality into your own Java programs.

Why JSch?

Originally, our motivation to develop this stuff is to allow users of our pure java X servers, WiredX, to enjoy secure X sessions. So, our efforts had mostly targeted to implement the SSH2 protocol for X11 forwarding. Of course, however, we are now also interested in adding other functionality like port forward, file transfer, terminal emulation, etc.

Features:

  • JSch is in pure Java, but it depends on Java Cryptography Extension (JCE). JSch is know to work with:
  • SSH2 protocol support.
  • Key exchange: diffie-hellman-group-exchange-sha1, diffie-hellman-group1-sha1
  • Cipher: blowfish-cbc, 3des-cbc, aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr, aes192-ctr, aes256-ctr, 3des-ctr, arcfour, arcfour128, arcfour256
  • MAC: hmac-md5, hmac-sha1, hmac-md5-96, hmac-sha1-96
  • Host key type: ssh-dss, ssh-rsa
  • Userauth: password
  • Userauth: publickey (DSA, RSA)
  • Userauth: keyboard-interactive
  • Userauth: gss-api-with-mic
  • X11 forwarding
  • xauth spoofing
  • connection through HTTP proxy.
  • connection through SOCKS5 proxy.
  • port forwarding.
  • stream forwarding.
  • signal sending.
  • environment variable passing.
  • remote exec.
  • generating DSA and RSA key pairs.
  • changing the passphrase for a private key.
  • partial authentication
  • SSH File Transfer Protocol(version 0, 1, 2, 3)
  • packet compression: zlib, zlib@openssh.com JZlib has been used.
  • hashed known_hosts file.
  • NONE Cipher switching. High Performance Enabled SSH/SCP supports NONE Cipher switching. Refer to ScpToNoneCipher.java.
  • JSch is licensed under BSD style license.

Official Website: http://www.jcraft.com/jsch/

Useful Links:

1673 questions
0
votes
1 answer

Entering data into an InputStream

I know that InputStreams are for reading, and OutputStreams are for writing... but if I have an application that passes all data from an InputStream to the remote side and pushes all received data from that remote side to the OutputStream and I need…
0
votes
1 answer

How to read input from Shell Session using JSch in Java?

I am trying to develop a Shell Emulator and using Jsch for the same. I am trying to open a shell session but I am not able to read the input stream from the Shell session. I am using the following code. JSch jsch = new JSch(); …
Jhamb
  • 31
  • 4
0
votes
1 answer

Write to remote file using SSH

I want to write a String generated by a POJO to be written to a file in a remote server accessible only through scp/ssh. Would like to avoid creating local temporary file and scp the files to the remote machines. Implementation using Jsch library is…
rogue-one
  • 11,259
  • 7
  • 53
  • 75
0
votes
0 answers

Intermittent issue with jsch while trying to run a shell script

I am trying to execute a shell script (which is in a different unix server). Now i have seen that sometimes it was unable to execute that script. As that script takes very long time to execute, therefore i cannot read/wait for the output. just…
Shibankar
  • 806
  • 3
  • 16
  • 40
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
1 answer

Can Jsch exec 3rd party linux shell?

I have successfully used jsch to execute linux system shell like "ls;pwd". Now I want to know can Jsch execute some 3rd party linux shell like "clish"?
liminche
  • 261
  • 1
  • 6
  • 13
0
votes
1 answer

SFTP Integration JSCH - Failed to execute on session

I have my Spring Integration sample program working with my Mac setup as local SFTP server (just as here) everything is working fine. I tried to replace my test credentials with the actual (our client/provider's) SFTP credentials and Spring…
oneworld
  • 770
  • 4
  • 17
  • 31
0
votes
1 answer

how to delete local file using jsch after file is sent to remote SFTP server directory

I'm calling jsch in our Mirth interface engine to copy files from our local directory to a remote sftp directory, I want to remove file from local directory after Channel.put has place the file on the remote server directory. Here is my initial code…
user3498953
  • 25
  • 2
  • 8
0
votes
2 answers

Remove special characters while using "more" command from Java using JSCH?

I have a log file on a UNIX server which is dynamically changing. I want to build an application to view that file on a Java GUI using Swings in multiple pages using SSH. I am using JSCH Library to execute the "more" command for that log file. But…
Jhamb
  • 31
  • 4
0
votes
1 answer

Execute the shell script present in remote server using java

Tried executing the .sh file present in the remote server with below code. String command1="/home/support/test.sh"; try{ java.util.Properties config = new java.util.Properties(); …
knix2
  • 327
  • 1
  • 5
  • 19
0
votes
1 answer

using matchpattern in sftp ls command

I have two files on my SFTP server xyz07012014abc.txt xyz06072014abc.txt I have a Java program having matchpattern as follows: month="07" and year="2014" matchPattern = "*" + month + "*" + year + "*"; Above matchpattern gets me both the files.…
hrishikeshp19
  • 8,838
  • 26
  • 78
  • 141
0
votes
1 answer

http request over ssh tunnel

I have two server. I use first server installed tor application on it for hide my ip adress. It will be named as SSH Tunnel Server henceforth. Second server is to send http request on ssh tunnelling. And it will be named as Client Sever. I wrote the…
RockOnGom
  • 3,893
  • 6
  • 35
  • 53
0
votes
2 answers

JSch sftp job summary

private final String host; private final String userAccount; private final String keyDir; private ChannelSftp sftpChannel; private Session session; private Channel channel public void send(List filesToSend, String…
M06H
  • 1,675
  • 3
  • 36
  • 76
0
votes
0 answers

Jsch sftp exception : file not found (even if the file exists)

I'm writing a jython code which use Jsch to run some shell instructions on a remote machine. I need to wait a specific shell instruction has finished before continuing the exectuion of the jython code on my local machine (=need to synchronize shell…
Charpi
  • 3
  • 4
0
votes
1 answer

Eclipse The chosen operation is not currenty available.(noclassdeffounderror)

I'm using the Jsch library in my eclipse plugin project and while running my project I'm getting the following runtime error. java.lang.noclassdeffounderror com/jcraft/jsch/jschexception. I included the Jsch jar path in…
Thushi
  • 188
  • 1
  • 13
1 2 3
99
100