You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by manco <me...@yahoo.com> on 2005/05/19 00:42:52 UTC

[VFS] problems connecting to one sftp site but not the other

Hi,
 
Ok, I can connect to one sftp site but not another. 
I had to turn off host checking to access the one that works but
that does not help me for the other one.
 
from the test Shell program ...
 
    private void cp(final String[] cmd) throws Exception
    {
        if (cmd.length < 3)
        {
            throw new Exception("USAGE: cp <src> <dest>");
        }
        // Testing for Sftp - turn off Strict Host Checking
        FileSystemOptions opts = new FileSystemOptions();
        SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(
           opts, "no");
        String cking = SftpFileSystemConfigBuilder.getInstance().getStrictHostKeyChecking(
               opts );
        final FileObject src = mgr.resolveFile(cwd, cmd[1]);
        FileObject dest = mgr.resolveFile(cmd[2], opts);
        if (dest.exists() && dest.getType() == FileType.FOLDER)
        {
            dest = dest.resolveFile(src.getName().getBaseName());
        }
        dest.copyFrom(src, Selectors.SELECT_ALL);
    }
 
> cp C:/TEMP/OUT/build.xml   sftp://user:password@A.B.C.D/home/out/
Command failed:
org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "sftp://user:password@A.B.B.C/".
 at org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:87)
 at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:76)
 at org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:61)
 at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:513)
 at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:466)
 at com.eMeter.util.vfs.vfstest.Shell.cp(Shell.java:205)
 at com.eMeter.util.vfs.vfstest.Shell.handleCommand(Shell.java:121)
 at com.eMeter.util.vfs.vfstest.Shell.go(Shell.java:95)
 at com.eMeter.util.vfs.vfstest.Shell.main(Shell.java:57)
Caused by: org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "A.B.C.D".
 at org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:166)
 at org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:79)
 ... 8 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
 at com.jcraft.jsch.Session.connect(Unknown Source)
 at com.jcraft.jsch.Session.connect(Unknown Source)
 at org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:162)
 ... 9 more

When I manually get into this site via an sftp client I do see some different behavior than
normal
1. login with servername, user, port
2. <after login and before request for password I get a popup warning>
3. then a password window
4. <then a  Enter Authentication Response popup which requires a button push ok>
 
for my sftp site that works i dont see neither #2 nor #4. 
 
Could this be some type of extra security measure?
 
Does it sound like a know standard? 
 
Is there a way to handle this in vfs/sftp/jsch?
 
This error looks suspect:
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1   (see above)

 
thanks,
Manco
 

 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [VFS] problems connecting to one sftp site but not the other

Posted by Mario Ivankovits <ma...@ops.co.at>.
manco wrote:
>This error looks suspect:
>Caused by: java.lang.ArrayIndexOutOfBoundsException: -1   (see above)
>  
Which version of "jsch" do you use?
If its not 0.1.20 please try it - get it from: http://www.jcraft.com/jsch/
Just to be sure its not a fixed bug.

Which version of jdk?

Which sshd server?
You can use "telnet sshd-hostname 22" to get the server identification.

---
Mario


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