[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-user
Subject: Re: [vfs] Issue encountered when connecting to a SFTP
From: Heshan Suriyaarachchi <heshan.suriyaarachchi () gmail ! com>
Date: 2011-01-11 5:39:13
Message-ID: AANLkTim2jTYLFkCn-21PHAh5F+bzWMV571eYz-dmXj_3 () mail ! gmail ! com
[Download RAW message or body]
Hi Steve,
Thanks for the response :)
On Thu, Jan 6, 2011 at 4:28 PM, Steven Siebert <smsiebe@gmail.com> wrote:
> Hi Heshan,
>
> You can either do that (tell VFS where the know-hosts file is):
> FileSystemOptions o = new FileSystemOptions ();
> SftpFileSystemConfigBuilder.getInstance().setKnownHosts(o, new
> File(myKnownHostsDir));
> FileObject fo = VFS.getManager().resolveFile(myURI, o);
>
> or tell it to ignore strict host key checking:
> FileSystemOptions o = new FileSystemOptions ();
> SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(o,
> "no");
> FileObject fo = VFS.getManager().resolveFile(myURI, o);
>
> see http://commons.apache.org/vfs/apidocs/index.html
>
> Cheers,
>
> Steve
>
> On Thu, Jan 6, 2011 at 12:46 AM, Heshan Suriyaarachchi <
> heshan.suriyaarachchi@gmail.com> wrote:
>
> > Hi,
> >
> > I am using VFS to connect to a SFTP. But when I try to connect to it, I
> am
> > getting the following stacktrace. Do I have to import the certificate key
> > (of the SFTP that I am trying to connect) to VFS? If so, how to do it?
> > Please advice.
> >
> > Caused by: org.apache.commons.vfs.FileSystemException: Could not connect
> to
> > SFTP
> > server at "example.foo.com".
> > at
> > org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnecti
> > on(SftpClientFactory.java:233)
> > at
> > org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSys
> > tem(SftpFileProvider.java:95)
> > ... 14 more
> > Caused by: com.jcraft.jsch.JSchException: UnknownHostKey:
> example.foo.com.
> > DSA key
> > fingerprint is 62:fa:a5:c7:1a:34:f4:05:7a:e8:06:b9:57:e5:de:e3
> > at com.jcraft.jsch.Session.checkHost(Session.java:706)
> > at com.jcraft.jsch.Session.connect(Session.java:307)
> > at com.jcraft.jsch.Session.connect(Session.java:150)
> > at
> > org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnecti
> > on(SftpClientFactory.java:229)
> > ... 15 more
> >
> > --
> > Regards,
> > Heshan Suriyaarachchi
> >
> > http://heshans.blogspot.com/
> >
>
--
Regards,
Heshan Suriyaarachchi
http://heshans.blogspot.com/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic