Skip to content
Advertisement

Tag: sftp

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

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:

How to execute shell command using SFTP channel in JSch?

I am trying to list all *.xml files in the directory. I do a cd first and then was trying to execute: But not sure how exactly to do it. There were some example around the Exec channel but is there a way to do the find with SFTP itself? Answer Your requirements are conflicting. You cannot execute shell commands

Apache Mina SFTP SftpSubsystem.Factory()

I am trying to setup a simple SFTP server using Apache Mine SSHD v1.2.0. I have looked at several examples on the web E.g. here, here and here. However they all have the same line in common which I cannot get NetBeans to resolve. NetBeans tells me that it cannot find Factory in SftpSubsystem. The line in question looks as

Advertisement