You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Matthias Kümmerer <mk...@web.de> on 2006/03/17 23:26:46 UTC

[vfs] UnkownHostKey

Hello,

Im am trying to establish an SFTP connection to an SFTP Server
(shell.sourceforge.net) with JCommander (jcommander.sourceforge.net),
which uses the commons vfs. Unfortunately I always get a
FileSystemExecption: "Could not connect to SFTP server at
"shell.sourceforge.net: UnknownHostKey: shell.sourceforge.net". Other
people are able to use JCommanders SFTP without any problems, but I
don't know, what I am doing wrong.

Although I read the documentation, I do not yet fully understand the
hostkey mechanism. Don't vfs create needed hostkeys on its own, possibly
after asking? I think I have read somewhere, that hosts are saved in
$HOME/.ssh/known_hosts. But this file does not exist, and creating it
does not help either.  I found the function
SftpFileSystemConfigBuilder.setStrictHostKeyChecking(), but I did not
find any information about how to use it, as JCommander uses the
FileSystemManager VFS.getManager(). But actually I should not have to
change anything in the code, as other people are able to uses it without
problems.

Any help would be very appreciated,
   Matthias
|*
<http://jakarta.apache.org/commons/vfs/apidocs/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.html#setStrictHostKeyChecking%28org.apache.commons.vfs.FileSystemOptions,%20java.lang.String%29>*|


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [vfs] UnkownHostKey

Posted by Jacob Kjome <ho...@visi.com>.
There are some ftp clients that automatically add entries to
$user_home/.ssh/known_hosts, but none of my clients on Windows do that.  If you
set strict host key checking to 'false', then JSCH, the library that provides
VFS with SFTP functionality, will write the host key to known hosts.  After
that, you won't need to set that flag because it will just read the host key
from known_hosts.

Jake

Quoting Matthias Kümmerer <mk...@web.de>:

> Hello,
>
> Im am trying to establish an SFTP connection to an SFTP Server
> (shell.sourceforge.net) with JCommander (jcommander.sourceforge.net),
> which uses the commons vfs. Unfortunately I always get a
> FileSystemExecption: "Could not connect to SFTP server at
> "shell.sourceforge.net: UnknownHostKey: shell.sourceforge.net". Other
> people are able to use JCommanders SFTP without any problems, but I
> don't know, what I am doing wrong.
>
> Although I read the documentation, I do not yet fully understand the
> hostkey mechanism. Don't vfs create needed hostkeys on its own, possibly
> after asking? I think I have read somewhere, that hosts are saved in
> $HOME/.ssh/known_hosts. But this file does not exist, and creating it
> does not help either.  I found the function
> SftpFileSystemConfigBuilder.setStrictHostKeyChecking(), but I did not
> find any information about how to use it, as JCommander uses the
> FileSystemManager VFS.getManager(). But actually I should not have to
> change anything in the code, as other people are able to uses it without
> problems.
>
> Any help would be very appreciated,
>    Matthias
> |*
>
<http://jakarta.apache.org/commons/vfs/apidocs/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.html#setStrictHostKeyChecking%28org.apache.commons.vfs.FileSystemOptions,%20java.lang.String%29>*|
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org