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.
1,668
questions
-1
votes
0
answers
18
views
Jsch connection refused when connect from within Junit
This exact code to open jsch ssh connection to a remote host fails when it run in a junit
@BeforeEach method, but work fine in main() of a java application.
String host = "192.168.1.100";...
2
votes
1
answer
107
views
SFTP Connection through OPENSSH IdentityFile in Java [duplicate]
I'm developing a Java application that has to store data inside an SFTP.
The test environment has a password authentication, meanwhile the production environment has an authorized OPENSSH key (the ...
0
votes
1
answer
90
views
Jsch getting disconnected on trying to connect to SFTP server under AWS Transfer Family
I am trying to use Jsch to connect to a SFTP server. My code looks like below
public void putFile(
final SftpConfig sftpConfig, final InputStream inputStream, final String remoteFileName) {
...
0
votes
1
answer
71
views
Connection to SFTP using Jsch throwing NullPointer
I am writing a basic application using jsch to try and connect with an AWS SFTP server.
I am using jsch version
implementation group: 'com.github.mwiede', name: 'jsch', version: '0.2.11'
When I try to ...
0
votes
0
answers
58
views
jsch library authentication failure with rsa-sha2-512 preauth failure
I am using https://github.com/mwiede/jsch library to establish ssh tunnel. The key is rsa and the handshake and host key verification is working fine. But the authentication is failing for rsa-sha2 ...
0
votes
0
answers
50
views
Apache MINA SSH shell session - List of available commands
I am working with Apache MINA SSHD (Backend) and Javascript (frontend) to make a terminal on the browser that connects to the SSHD on the server and create an SSH connection.
This is working fine and ...
0
votes
0
answers
33
views
What would cause com.jcraft.jsch.KeyExchange.verify throws null pointer when calling session.connect()
java.lang.NullPointerException at
com.jcraft.jsch.KeyExchange.verify(KeyExchange.java:368) at
com.jcraft.jsch.DHECN.next(DHECN.java:178) at
com.jcraft.jsch.Session.connect(Session.java:330)
...
0
votes
1
answer
101
views
Apache Camel SFTP : Auth cancel for methods 'publickey,gssapi-keyex,gssapi-with-mic,password'
I am trying to connect a SFTP server with Private Key but I am getting this error. (Private Key works with WinSCP and Filezilla)
org.apache.camel.component.file.GenericFileOperationFailedException: ...
0
votes
0
answers
152
views
Gerrit Trigger lost connection due to com.jcraft.jsch.JSchAlgoNegoFailException
The Gerrit Trigger plugin worked well previously, but from a time point that I couldn't figure out, the connection can never be established with following error message:
Connection error : com.jcraft....
0
votes
0
answers
93
views
Java com.jcraft.jsch.JSch session not getting disconnect
I am using jcraft JSCH package to do ssh to a HP router and execute some CLI commands.
After execution of commands I am calling session disconnect method. But this session disconnect method is getting ...
-1
votes
1
answer
65
views
Reading file data from Multiple SFTP servers using JSch
Could any one provide info on, how to connect to multiple SFTP servers with Java JSch client?.
I have around Four remote SFTP servers containing files, and expectation is read the files from all the ...
0
votes
0
answers
19
views
Same JSch Channel object is used for long term, could cause memory issue
We are reading the files using JSch Channel continuously from a specific location. There is another program that adds the files on designated location continuously and from same location the JSch read ...
1
vote
1
answer
42
views
When I use JSch, can I use custom OutputStream with the socket?
When I use JSch lib, can I use custom OutputStream?
I want to wrap JSch message with Google Proto. So I have to use custom OutputStream.
I knew that JSch could set custom SocketFactory. So I made a ...
0
votes
1
answer
281
views
JSch End of IO Stream Read
I'm testing out JSch to send SSH command to a remote server. Here's a snippet of my code
try {
session = new JSch().getSession(username, host);
session.setPassword(password);
session....
0
votes
0
answers
83
views
Can I connect to an SFTP server via HTTPS Proxy in Java?
I would like to connect to an SFTP server by tunneling over an HTTPS proxy. I see that Java Proxies, support three different types: Direct, HTTP, and Socks, but not HTTPS. Is there any way I can ...
0
votes
0
answers
46
views
is Channel object of JSch thread safe [duplicate]
I want to connect to same host with multiple threads and perform some ssh operations. Can we share the channel object between threads. I tried to use but getting error like java.io.ioexception pipe ...
0
votes
0
answers
206
views
SSH Connection Issue in Spring Boot Application
I have a remote database currently hosted on namecheap via premium208.web-hosting.com using the cpanel which only allows SSH connections to the database that i want to use in my spring boot ...
-1
votes
1
answer
57
views
Cannot change Java Swing UI from Jsch's SftpProgressMonitor
I'd like to use SftpProgressMonitor's count() method to update the percentage of completion of a SFTP operation. I know it is better to use Worker threads in order not to block the UI, but I am ...
0
votes
1
answer
94
views
How to handle resources in JSCH exec correctly?
I've found example of ssh connection:
public static void listFolderStructure(String username, String password,
String host, int port, String command) throws Exception {
...
0
votes
0
answers
57
views
How to use execute command and sftp file transfer in the jsch session with java [duplicate]
I have to copy the log files from unix server. in putty after login, I have to run sudo su -o oper command. once sudo code executed.. move to the logs folder using cdlog command then downloads the ...
0
votes
0
answers
17
views
How to use Jsch to copy a file from a remote directory to another remote directory [duplicate]
I'd like to use Jsch to copy a file from a remote directory to another remote directory.
For now I've just done a simple ssh command: cp remoteSource remoteDest but is there a "better" way ...
0
votes
0
answers
108
views
Port forwarding using JSCH: Expected solution does not work, and the solution which does work makes no sense to me
I have a reasonably simple requirement: I need to open a SSH connection to a Remote server from my Java server using JSCH. I don't have direct access, so I need to do it via a Jump server.
First I ...
0
votes
1
answer
279
views
Apache vfs/jsch sftp Algorithm negotiation fail
I'm trying to connect to a sftp server, which I connect to via commands using sftp -oHostKeyAlgorithms=+ssh-dss user@host. However, when I try to connect via my java-spring application, using apache ...
1
vote
0
answers
778
views
com.jcraft.jsch.JSchException: Auth fail whith public key authentication
I'm trying to create a ssh client in java in order to run remote command on an appliance.
With Username/Password authentication I havent' problem, it works fine, but with Public Key Auth it don't ...
0
votes
0
answers
21
views
Apche camel SFTP transfer failover not moving to the next active connection in java
I have two active connections:
1.connectionA
2.connectionB
My LoadBalancer code looks like this:
methodA() {
configureOnExceptions();
LoadBalanceDefinition loadBalanceDefinition =
from(uri)
...
1
vote
0
answers
93
views
Apache camel memory issue with dynamic SFTP uri for file processing
Our application has been throwing OutOfMemory for quite sometime. At first we thought it is due to inefficient usage of collections but on deeper analysing the application and heapdump, it looks like ...
0
votes
1
answer
414
views
Android VpnService using JSch SSH-Connection , It connects to the server but does not have access to the Internet
I am using the source below to connect to the server via SSH. There are no errors in the program. The key icon will appear at the top of the mobile screenVPN Connected Image1. But I do not have access ...
0
votes
1
answer
42
views
Parse JSCH response to list
I'm trying to parse the response from JSCH (it was a grep cmd with multiple lines as a response) and i'm trying to add each line to a list (for later processing). I'm using the shell channel if that ...
1
vote
0
answers
119
views
Spring Integration Module that Continuously Polls SFTP Stalled
I have an application which uses spring integration to poll the sftp and once it finds new file thats when spring batch kicks-in and processes the file. I have five such jobs written in an application ...
-1
votes
1
answer
180
views
JSCH: Success uploading file but not in the right extension
So I uploaded my file to SFTP directory successfully. But here's the thing. The file uploaded is in "File format" and its name is the same as its directory.
But the actual file is in .jpg ...
0
votes
0
answers
62
views
Jsch Channel isClosed vs isConnected method
In Jsch Channel class(https://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/Channel.html) there are 2 methods - isClosed and isConnected.
I think before calling connect() on the channel, ...
1
vote
1
answer
47
views
Is reading InputStream required to execute command (nohup) on remote SSH server using JSch?
I'm trying to execute a script in background with nohup and want to disconnect without reading output. Is it required to get and read input stream channel.getInputStream(); in.read(...) in this case?
...
1
vote
1
answer
245
views
Communicate through JSch SSH tunnel with remote process/server
I'm trying to do programmatically in JSch what works fine in Bash. I set up an SSH tunnel and then communicate through the tunnel. I'm supposed to send an authentication string every 10 seconds or ...
0
votes
1
answer
285
views
In JSch, what does 'invalid handle' mean?
I am using JSch with Spring Integration to store files from our Spring Boot app to an SFTP server. Recently, the uploads started to fail with the following error:
Caused by: org.springframework....
0
votes
0
answers
27
views
How to make JDK1.7 uses 2048 bit primes in JSch
Referring the below question
Using 2048 bit primes in JSch
I use JDK1.7 and get the same error as it was posted in the above link. If I change to JDK1.8, all works fine.
Do I have to go through the ...
1
vote
0
answers
26
views
com.jcraft.jsch.JSchException: Auth fail at runtime [duplicate]
I am trying to connect amazon ec2 instance with the help Java JSCH library version: 0.1.55 with jdk 19. I am able to login manually via putty and cmd but when I am logging in through Java then I am ...
0
votes
1
answer
252
views
Is my jsch connection pool being used thread safely in Spring controller?
I'm trying to implement a connection pool using https://commons.apache.org/proper/commons-pool/ with JSch and use it in a Spring rest controller. I coded based on this stackoverflow answer: https://...
1
vote
1
answer
297
views
How to use private key without password in JSch?
I am trying to use JSch to SFTP a file to a remote location. Per this article, when you do SFTP, you can use either a private key or a password for authentication. We are doing private-key ...
2
votes
2
answers
707
views
JSch - No progress after SSH_MSG_KEXINIT is sent
Simple Java app using JSch (0.1.55) library to connect to SFTP server.
Hangs at the key exchange step after SSH_MSG_KEXINIT sent. Logging below.
Code fails on Windows test machine which is able to ...
0
votes
1
answer
62
views
Memory Efficient Abstract Linear data type to store and iterate 1 million to 2 million records in java - Apache camel
This is a curiosity question, recently we faced out of memory issue with one of our microservices. This memory issue happens once in a month so basically application is running for 1 month without any ...
1
vote
0
answers
158
views
How to run an SSH command on a remote machine using JSCH via GSSAPI/Kerberos in a Java web app with Waffle SSO auth/JAAS?
I am using a Java Spring Boot application with Waffle SSO library waffle-spring-security4 2.0.0 and have installed and configured MIT Kerberos. The ticket cache is working fine, and running "...
1
vote
0
answers
822
views
SocketTimeoutException:java.net.SocketTimeoutException: Read timed out caused by JSchException:com.jcraft.jsch.JSchException: Auth fail
I have a socket service, which is listening for when a request arrives, from a client also in java, when this request arrives, the service connects via ssh to a server to retrieve information. The ssh ...
0
votes
0
answers
17
views
“Socket Not Established” Error in JSch session.connect() when called from AWS Lambda [duplicate]
I have a standalone java code with a main() method and this code has logic to SFTP a file from my local machine to another remote machine using JSch API. This code is working fine when I run it as a ...
0
votes
1
answer
59
views
libpam-google-authenticator. Couldn't authorize with gradle pugin org.hidetake.ssh
I'm trying to log in to the SSH host using the user, private key and google authenticator, via Gradle plugin: 'org.hidetake.ssh' but I get error:
com.jcraft.jsch.JSchException: Auth cancel for methods ...
0
votes
0
answers
156
views
Read file attributes of any file available at server without downloading it
We have one SFTP server where we placed one file present in ./test/directory1/test.csv.
We added one custom attribute to this file before placing it to this directory , attribute name "user....
1
vote
1
answer
857
views
JSch Algorithm Negotation Fail [duplicate]
I am trying to connect to an SFTP server but I am receiving the following exception:
com.jcraft.jsch.JSchException: Algorithm negotiation fail
When using the following connection code:
final ...
1
vote
1
answer
91
views
Running parallel uploads with multiple users using jmeter
I have a jmx script which makes jsch connection and upload files in parallel using ultimate thread group with one user with below configuration and provide output as well
Ultimate Thread Group
Start ...
0
votes
0
answers
17
views
Send files from one remote server using JSch to another server using JSch [duplicate]
Please refer to an existing question regarding the same
Send files from one remote server using JSch to another server using JSch too
public boolean uploadFile() throws JSchException, SftpException {
...
0
votes
0
answers
144
views
com.jcraft.jsch.JSchException: Auth fail in ktor kotlin
I am new to programming.
I have a built a backend using ktor and now I want to deploy that app to a server.
I have tried deploying it multiple times on a virtual private server but every time I get ...
-1
votes
1
answer
63
views
Does anyone implemented JSch using Kerberos/GASAPI-based authentication
As we are in corporate environment and with basic configuration changes, SSH Kerberos working seamlessly in OpenSSH
SSH -K [email protected]
Since default Kerberos setup didn't work, we have ...