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
0 answers

How do I start a browser in a remote ubuntu system?

I am running two Ubuntu 12.04 machines. Machine A needs to start a browser (firefox or chrome) on machine B but it is not required for it to see the browser window. It just needs to start the browser and leave it. I have implemented it using JSch…
sundeepa
  • 55
  • 1
  • 11
0
votes
2 answers

How to Execute Putty commands in java to move files between folders(mv command)

I have written a java code that can connects using Jsch, and can Upload and download files between the local machine and server. But I am not sure how to execute commands like 'mv' to move files between folders withing the server using java. To list…
Ragesh Kr
  • 1,573
  • 8
  • 29
  • 46
0
votes
0 answers

Camel SFTP Component: different behavior running on Windows and CentOS

I am using using camel-sftp to retrieve some files from a remote SFTP Server and after retrieving them I want to delete them. When I am running my route in Windows files get deleted and everything works as expected. However, when running on CentOS…
hveiga
  • 6,725
  • 7
  • 54
  • 78
0
votes
0 answers

JSch stdout not appearing when running from command line

When I run the following code which is a modified block from one of the jsch examples. The ssh command works but although I can see subsequent stdout/stderr in eclipse or jdb I cannot see output when I run outside eclipse. I assume that stdout…
0
votes
1 answer

jsch auth fail without private key

I'm using Jsch for executing ssh commands. When I pass private key it works well, but I need it to work without private key passing (it was already copied there). So in console I can ssh to this server without anything. But Jsch throws Auth Fail.…
0
votes
1 answer

Apache VFS sftp- is getting multiple fileObjects creating multiple sessions or channels?

Consider the following code: FileSystemManager fsManager = VFS.getManager(); FileObject sftpDir = fsManager.resolveFile("sftp://username:password@host/pub/downloads/"); FileObject child1 = sftpDir.getChild("child1.data"); FileObject child2 = …
0
votes
2 answers

JavaFX task communication

I'm trying to do a infinity loop who change my UI. But until loop ends my UI doesn't change. I'm trying to do it with Tasks, one task in the loop and the other changing the UI but I don't know how to communicate the tasks. In my concrete problem I'm…
Charlio
  • 78
  • 2
  • 8
0
votes
1 answer

Issue with buffer when using jsch

I am currently having an issue implementing the jsch library to grab information from a ZyXel switch. The program itself will grab some information to confirm the type of switch and then upload the correct firmware and config. My issue, to me,…
kmalik
  • 109
  • 1
  • 2
  • 11
0
votes
1 answer

Java SFTP/SSH directory does not delete/remove the directory

I tried googling everywhere, but cannot find anywhere. I am trying to accomplish is to go to SFTP or SSH and delete/remove the directory. here is my code. any help is appreciated. this code does not delete and remove the directory as it suppose…
jimagic
  • 4,045
  • 2
  • 28
  • 49
0
votes
1 answer

SCP files to remote host in JAVA using JCraft's JSch API

I am able to scp a single file to the remote machine on an existing folder using JSch API but not able to do so if the folder doesn't exists on remote. On each run I would need to SCP files to unique folder that has name with date time format. Since…
user2191296
  • 65
  • 1
  • 10
0
votes
2 answers

How to use an alias on server with JSch?

I want to use an alias in my JSch-connection. I successfully built a connection to the Linux-Server. In the Linux-Server there's an alias for ls -l called ll. When I type the alias in PuTTY I have no problems, but through JSch I get the following…
t.koelpin
  • 57
  • 9
0
votes
1 answer

Running SSH commands from an android application over Wi-Fi

I am completely new to android development. I am looking for a way to execute ssh commands from an android application which will be used on a tablet in future. In particular i need to execute 4 ssh commands to 4 separate servers over wifi. I have…
srai
  • 1,023
  • 2
  • 14
  • 27
0
votes
0 answers

upload 1 GB file to unix sever using java

My requirement is to copy the file from local machine(Windows) to unix serevr. I have the code which was working fine with some Mbs data. i am using jsch lib to connect and to transfer. But now i have to transfer the files of 1GB, 2Gb or may be…
user23385
  • 111
  • 2
  • 12
0
votes
0 answers

How to resolve Connection timed out exception when using Jsch through Jump server?

I am trying to connect to a server through a jump server. I am using Jsch 0.51 and trying to connect using the setPortForwardingL method. However, I am getting the following exception while connecting: java.net.ConnectException: Connection timed…
vaisakh
  • 1,041
  • 9
  • 19
0
votes
1 answer

Sudo in Jsch (for Android)

I'm using JSch in Android to create an SSH connection to execute a command and store in a string the result of this execution. I succeeded, but I have a problem. If I run a command with "sudo" in the string is NOTHING stored. IN fact what is…
Paul9999
  • 751
  • 1
  • 11
  • 26