Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.6k views
in Java FTP by (160 points)
I've been using edtFTPj/PRO to transmit files via SFTP with much success in the past, however I'm now experiencing an authentication problem with a new setup that I can't seem to resolve. I've generated a new RSA keypair for the client just for this connection and added it to the authorized_keys on the server, and I've been able to use this key to connect using both the sftp / ssh command line and with FileZilla (after converting the key to PuTTY format). However with edtFTPj/PRO I'm getting a failure. I was experiencing this on v1.2, so I just upgraded to v1.5.7 and am receiving the same behavior. The code is as follows:

            
            SSHFTPClient ftp = new SSHFTPClient();
            ftp.setConfigFlags(SSHFTPClient.ConfigFlags.DISABLE_CHMOD_AFTER_PUT);
            ftp.setRemoteHost(host);
            ftp.setRemotePort(Integer.parseInt(port));
            ftp.getValidator().addKnownHost(host, hostKey.getAbsolutePath());
            ftp.setAuthentication(clientKey.getAbsolutePath(), username, passphrase);
            ftp.connect();


I've attached the debug log from the client below. Unfortunately I don't have server logs as it's a production machine without debugging enabled. Any ideas on where to look?
Thanks,
Jason Blumenkrantz
Online Banking Solutions

>>[DEBUG][2008-04-28 14:01:19,471][~SCPClient]-Class: com.enterprisedt.net.ftp.ssh.SSHFTPClient
Version: 1.5.7
Build timestamp: 3-Apr-2008 09:50:29 EST
Java version: 1.6.0_04
OS name: Linux
OS arch: i386
OS version: 2.6.23.12-52.fc7

>>[DEBUG][2008-04-28 14:01:19,471][~SSHFTPClient]-Created SFTP client.
>>[DEBUG][2008-04-28 14:01:19,471][~SSHFTPValidator]-Adding known host '192.168.10.181'
>>[DEBUG][2008-04-28 14:01:19,471][~SshPublicKeyFile]-Parsing public key file
>>[DEBUG][2008-04-28 14:01:19,471][~SshPublicKeyFile]-
Public key is not in the default format, attempting parse with other supported formats
>>[DEBUG][2008-04-28 14:01:19,471][~SshPublicKeyFile]-Attempting SECSH-PublicKey-Base64Encoded
>>[DEBUG][2008-04-28 14:01:19,471][~SshPublicKeyFile]-Attempting OpenSSH-PublicKey
>>[DEBUG][2008-04-28 14:01:19,472][~AbstractKnownHostsKeyVerification]-
Allowing 192.168.10.181 with fingerprint 1026: 
ce 9b b 2f 4 dc e5 ed 89 23 95 85 85 87 31 c
>>[DEBUG][2008-04-28 14:01:19,472][~AbstractKnownHostsKeyVerification]-
putAllowedKey(host=192.168.10.181,algorithm=ssh-dss)
>>[DEBUG][2008-04-28 14:01:19,472][~SshPrivateKeyFile]-Parsing private key file
>>[INFO][2008-04-28 14:01:19,472][~OpenSSHPrivateKeyFormat]-Unpacking OpenSSH formatted private key
>>[INFO][2008-04-28 14:01:19,476][~OpenSSHPrivateKeyFormat]-RSA private key
>>[INFO][2008-04-28 14:01:19,476][~SCPClient]-SCPClient settings validated.
>>[DEBUG][2008-04-28 14:01:19,476][~SCPClient]-Connecting to 192.168.10.181:22
>>[DEBUG][2008-04-28 14:01:19,476][~TransportProviderFactory]-Connecting to 192.168.10.181:22 via standard socket
>>[DEBUG][2008-04-28 14:01:19,476][~SocketTransportProvider]-Invoking connect with timeout=60000
>>[INFO][2008-04-28 14:01:19,507][~TransportProtocolCommon]-Timeout=60000
>>[DEBUG][2008-04-28 14:01:19,507][~TransportProtocolCommon]-Starting transport protocol
>>[INFO][2008-04-28 14:01:19,507][~TransportProtocolCommon]-Wait for state update timeout=60000
>>[INFO][2008-04-28 14:01:19,507][~TransportProtocolCommon]-Wait for state update timeout=60000
>>[DEBUG][2008-04-28 14:01:19,507][~TransportProtocolCommon]-
Registering transport protocol messages with inputstream
>>[DEBUG][2008-04-28 14:01:19,508][~TransportProtocolCommon]-Negotiating protocol version
>>[DEBUG][2008-04-28 14:01:19,508][~TransportProtocolCommon]-Local identification: SSH-2.0-edtFTPjPRO-1.5.7
>>[DEBUG][2008-04-28 14:01:19,544][~TransportProtocolCommon]-EOL is guessed at LF
>>[DEBUG][2008-04-28 14:01:19,544][~TransportProtocolCommon]-Remote identification: 'SSH-1.99-OpenSSH_3.9p1'
>>[DEBUG][2008-04-28 14:01:19,544][~TransportProtocolCommon]-Protocol negotiation complete
>>[DEBUG][2008-04-28 14:01:19,544][~TransportProtocolCommon]-Name=SSH_MSG_KEX_INIT,MessageId=20
Supported Kex diffie-hellman-group1-sha1
Supported Public Keys ssh-dss,ssh-rsa
Supported Encryption Client->Server 3des-cbc,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc
Supported Encryption Server->Client 3des-cbc,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc
Supported Mac Client->Server hmac-sha1,hmac-md5-96,hmac-sha1-96,hmac-md5
Supported Mac Server->Client hmac-sha1,hmac-md5-96,hmac-sha1-96,hmac-md5
Supported Compression Client->Server none,zlib
Supported Compression Server->Client none,zlib
Supported Languages Client->Server
Supported Languages Server->Client
First Kex Packet Follows [FALSE]
>>[INFO][2008-04-28 14:01:19,545][~TransportProtocolCommon]-Wait for state update timeout=60000
>>[DEBUG][2008-04-28 14:01:19,580][~SshMsgKexInit]-Packetlength=636, Paddinglength=11
>>[DEBUG][2008-04-28 14:01:19,581][~TransportProtocolCommon]-Received registered message: 
Name=SSH_MSG_KEX_INIT,MessageId=20
Supported Kex diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
Supported Public Keys ssh-rsa,ssh-dss
Supported Encryption Client->Server aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
Supported Encryption Server->Client aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
Supported Mac Client->Server hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,
hmac-sha1-96,hmac-md5-96
Supported Mac Server->Client hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,
hmac-sha1-96,hmac-md5-96
Supported Compression Client->Server none,zlib
Supported Compression Server->Client none,zlib
Supported Languages Client->Server
Supported Languages Server->Client
First Kex Packet Follows [FALSE]
>>[DEBUG][2008-04-28 14:01:19,581][~TransportProtocolCommon]-Received remote key exchange init message
>>[DEBUG][2008-04-28 14:01:19,581][~TransportProtocolCommon]-Starting key exchange
>>[DEBUG][2008-04-28 14:01:19,581][~TransportProtocolCommon]-Determine Algorithm
>>[DEBUG][2008-04-28 14:01:19,581][~TransportProtocolCommon]-Client Algorithms: [diffie-hellman-group1-sha1]
>>[DEBUG][2008-04-28 14:01:19,581][~TransportProtocolCommon]-Server Algorithms: 
[diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1]
>>&#

2 Answers

0 votes
by (162k points)
Connect with ssh -vvv to get max debug, and email it to us (support at enterprisedt dot com).

Also use the ALL logging level and send us the EDT log as well.
0 votes
by (160 points)
Turns out it was an error in out code, everything worked great once the right key was being specified.
Thanks,
Jason

Categories

...