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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

manco
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:[hidden email]/home/out/
Command failed:
org.apache.commons.vfs.FileSystemException: Could not connect to SFTP server at "sftp://user:[hidden email]/".
 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 
Reply | Threaded
Open this post in threaded view
|

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

Mario Ivankovits
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

manco
In reply to this post by manco
Mario,
 
-bash-2.05b$ telnet A.B.C.E. 22
 
<<< Responds with >>>

Trying A.B.C.E....
Connected to A.B.C.E.(A.B.C.E.).
Escape character is '^]'.
Use and access to this service is restricted to authorized users of Name
Technology, Inc. only.  Access by anyone else is prohibited. Each Name
authorized user must comply with Name's use and access policies when
accessing this service.
 
Usage is monitored.  
 
SSH-2.0-OpenSSH_3.7p1
ls
Protocol mismatch.
Connection closed by foreign host.

anything I type after the SSH-2.0-OpenSSH_3.7p1 gives me the above Protocol mismatch
and closes the connection. I assume this is because I am trying to telnet into a SSH port
server.
------------------------------------------------------------------------------------------------------------------------------------
I tried an ssh login directly:
 
-bash-2.05b$ ssh -l username A.B.C.E
 
<<< Responds with >>>

The authenticity of host 'A.B.C.E (A.B.C.E)' can't be established.
RSA key fingerprint is 22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:11:22.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'A.B.C.E'(RSA) to the list of known hosts.
Use and access to this service is restricted to authorized users of Name
Technology, Inc. only.  Access by anyone else is prohibited. Each Name
authorized user must comply with Name's use and access policies when
accessing this service.
Usage is monitored.
Password: *********
-bash-2.05b$    ( at this point I am into the ssh/sftp site)
 
(NOTE: I do have authorization to use this site, and FTP access with the same
            username/password combination does work in the VFS shell program)
 
 
Jars Used:

   zip:///[C%|/Test/work/vfs/libs/LOG4J/log4j-1.2.8.jar]
   zip:///[C%|/Test/work/vfs/libs/JSCH/jsch-0.1.20.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/commons-collections-3.1.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/commons-compress-20040530.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/commons-httpclient-2.0.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/commons-logging-1.0.4.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/commons-net-1.3.0.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/jcifs-0.8.3.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/oro-2.0.8.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/webdavlib-2.0.jar]
   zip:///[C%|/Test/work/vfs/libs/VFS/xml-apis-1.0.b2.jar]
-bash-2.05b$ java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

Thanks,
Manco

Mario Ivankovits <[hidden email]> wrote:
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: [hidden email]
For additional commands, e-mail: [hidden email]


               
---------------------------------
Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.
Reply | Threaded
Open this post in threaded view
|

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

Mario Ivankovits
Hi!

><<< Responds with >>>
>
>Trying A.B.C.E....
>Connected to A.B.C.E.(A.B.C.E.).
>Escape character is '^]'.
>Use and access to this service is restricted to authorized users of Name
>Technology, Inc. only.  Access by anyone else is prohibited. Each Name
>authorized user must comply with Name's use and access policies when
>accessing this service.
>
>Usage is monitored.  
>
>SSH-2.0-OpenSSH_3.7p1
>  
Looks like this is the problem.
I am not 100% sure, but I think jsch has some problems with the "use and
access ..." prolog.

If you find some time, please post this to the mailinglist at
http://www.jcraft.com/jsch/

In the meantime I will try to figure out how I can configure my sshd
server to print such a prolog too so see if this is really the problem.

Thanks!
---
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]