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 <[EMAIL PROTECTED]>:

> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to