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

File not uploading file over ssh if the size is under 200KB

I am trying to upload a file that is about 6kb to a ssh server. I have tried using the command on my terminal and even tested other commands and they work. Whats even weirder is that it will upload anything that is 200KB or bigger. I cant figure out…
wizage
  • 304
  • 4
  • 20
0
votes
1 answer

Hibernate through SSH

How can I change my hibernate.cfg.xml to connect to a MySQL Server port 3306 on another machine through SSH port 22? Is it possible to enter the SSH details into hibernate.cfg.xml? If not, is there a better way to do it? I already read this post but…
user1191027
0
votes
1 answer

Jsch sftp channel state impact by previous channel state of the same session?

In my code I am trying to keep the Jsch session active cause I expect many interactions with the server will happen. And the logic is: One thread will open channel on the session to check if a file exists Another thread try to open channel on the…
Gelin Luo
  • 14,035
  • 27
  • 86
  • 139
0
votes
0 answers

SSH/SSH2 : Is there a way to find out when the server is ready for receiving input?

When using some programming language (in my case Java w/ Jsch) or SSH client (i.e. SecureCRT), I am able to interact with the remote system terminal as if I was really on that system. How does the client know when the server is ready for input. As…
codecitrus
  • 659
  • 6
  • 17
0
votes
1 answer

JSch Fingerprint in Database

I have a Java Servlet application that uses JSch to SFTP documents from our SAN to the Servlet application and all works well. However, it is running on Windows and to get this working we had to locate the "Host Key Fingerprint" created when we…
AJF
  • 1,801
  • 4
  • 27
  • 54
0
votes
0 answers

SSH to Remote server from another server in Java

I am working on running a shell script from Java. I was able to ssh successfully to a server using JSCH using the steps mentioned [here]. Now my requirement is, I need to ssh to server1 , and then ssh to server2 from server1. After ssh to server2, I…
madhuram2468
  • 41
  • 1
  • 5
0
votes
1 answer

Make SSH Connection and Run An Executable in Java

I want to connect to a server using ssh and run an executable on the server from my local Java code. I am aware of the thread SSH connection with Java but the trouble is I can not figure out how to use sftpChannel (an object of ChannelSftp) to run a…
user1935724
  • 554
  • 1
  • 6
  • 18
0
votes
1 answer

Creating a new file in SSH enabled system using JSCH

I want to create a new file in ssh enabled system using JSCH. Can any one please suggest me some examples of connect to the ssh system using JSCH. Thanks in advance
supraja
  • 85
  • 1
  • 7
0
votes
3 answers

JSch shell returns into StringArray

I am trying to relearn Java after 10 years of not touching it. I want to create a library using JSch from some other apps I am looking to write. I have the connections ironed out but I am using stdin and stdout right now. I am looking to have a…
vSteve
  • 63
  • 1
  • 1
  • 8
0
votes
1 answer

Android/Jsch - SSH Output always empty

I have the exact same problem described here: SSH Output always empty Unfortunately the accepted answer doesn't work for me, because bufferedReader.readLine() ends up in a loop, probably because of the missing end of line. In addition I don't get…
user2158143
  • 123
  • 1
  • 2
  • 10
0
votes
1 answer

java jsch su- root (how can i?)

I want to connect a Linux server and execute a command, but when I send the command sh and su - it requires password, but my program sends password just before it asks. How can i solve this problem? public class Stream { public void…
RecreatioN
  • 31
  • 1
  • 10
0
votes
1 answer

automatically add datasource to standalone.xml in jboss as 7.1.1 on deploying ear application using entity bean

My JBOSS server (version 7.1.1 Final) is running in linux server. One of my ear application is deployed using jbosscli.sh by connecting to the vm using jsch. My application has an ejb (3.0) module containing entity beans. How to add datasource to…
shomik naik
  • 235
  • 1
  • 3
  • 12
0
votes
1 answer

Jsch on Ubuntu 12.04 import statement

I am trying to use the jsch package, to test its scp capability inside Java. I tried to install libjsch-java via apt-get to find it was already installed. When I tried to compile the script on this page it said the package does not exist:…
0
votes
1 answer

Copy video from my own machine to EC2 server by running scp command (JSCH)

I need to SCP a video file from my local machine to a EC2 cloud server using a Java program. I am using the JSCH library to do so. So far I can connect to the EC2 server and can run basic commands on it. Following is the code: import…
user3345895
0
votes
1 answer

Cant send command to Rpi with jsch

I am trying to do a simple android aplication to send two commands (start and stop xbmc) to my raspberry pi running RaspBMC. I am using jsch library for SSH connection. Here is my code: public void onToggleClicked(View view) { boolean on =…
A1t0r
  • 469
  • 5
  • 26
1 2 3
99
100