Skip to content

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

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

JSchException: Algorithm negotiation fail

I am trying to connect to remote sftp server over ssh with JSch (0.1.44-1) but during session.connect(); I am getting this exception: Logs from JSch: I am able to log in to remote server with linux sftp command. I was trying to find any kind of clue in the internet but I failed. Debug output from linux sftp command: Answer