commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Commons Wiki] Update of "VfsFaq" by WolframLanger
Date Mon, 07 Sep 2009 14:08:17 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification.

The following page has been changed by WolframLanger:
http://wiki.apache.org/commons/VfsFaq

The comment on the change is:
VFS FAQ: Add question about SFTP, setStrictHostKeyChecking

------------------------------------------------------------------------------
  ((DefaultFileSystemManager) fsManager).close();
  }}}
  
+ == How can I connect to an SFTP server even if there is no entry in known_hosts? ==
+ 
+ JSch, the library that provides VFS with SFTP functionality, checks that the host one tries
connecting to is a known host, i.e. has an entry in the file $HOME/.ssh/known_hosts. By default,
connections to unkown hosts are rejected by throwing an exception. You can change this behaviour
by specifying the strict host key checking option:
+ 
+ {{{
+ FileSystemOptions opts = new FileSystemOptions();
+ SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(opts, "no");
+ FileSystemManager fsManager = VFS.getManager();
+ FileObject foo = fsManager.resolveFile("sftp://login:password@host/foo.bar", opts);
+ 
+ // Do some stuff
+ 
+ foo.close();
+ ((DefaultFileSystemManager) fsManager).close();
+ }}}
+ 

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


Mime
View raw message