Skip to content
Advertisement

Tag: jsch

Retrieving host key of remote SSH server using Java

I want to be able to retrieve the host key of a remote SSH host using Java code. Is there any library that does this, I looked into JSch but couldn’t find what I wanted. I am aware that I can run the terminal command ssh-keyscan <hostname> through Java, but I want this to be the last resort. Seeking better

JSch SFTP connections getting stuck

We have a java 7 code base where we are using Apache commons vfs2 v2.2 which is using JSch-0.1.54 as sftp provider. Now, the use case is to transfer files to a remote host via sftp. But, every now and then, the file upload process gets stuck. After taking the thread dump of the application, we found both the threads

Use public key fingerprint in Java Spring Boot application to solve “The authenticity of host ‘xxxx’ can’t be established”

I have a Java Spring Boot application which is using the spring-integration-sftp dependency to connect to an SFTP server. I get an error The authenticity of host ‘xxxx’ can’t be established and I know this can easily be rid of by setting the sftpSessionFactory.setAllowUnknownKeys(true), but that is not a good practice and I would rather not do that. I have

SSH password authentication in Java using jcraft JSch fails with “Auth fail” but command-line “ssh” works

My system’s OS is Ubuntu 18. I am trying to connect SFTP through Java jcraft JSch but facing this exception: com.jcraft.jsch.JSchException: Auth fail Below are working: From terminal using sftp works fine with username and password, no issues. From FileZilla also it is working fine. Maven Dependency: Output: Terminal command sftp -vvv output: sftp -o “PreferredAuthentications password” -vvv username@host Output:

Advertisement