I'm using camel-ftp for sftp communication. Under the hood, jsch is being
used. The sftp server is Serv-U.
Normal user/password authentication works perfectly but not public key
authentication. I generate key pairs using Serv-U. The public key is used by
Serv-U while camel-ftp (jsch) is configured with the private key. I manage
to connect to Serv-U but never to log in. The key type is DSA and the key
length is 1024. The private key looks lilke this:
-----BEGIN DSA PRIVATE KEY-----
MIIBugIBAAKBgQCR+zLyBwj0gcvNh6xmauvc2YdYYEjjoXdIUpzb01zmwFzqia9q
nWCTL5t3iwqgBrZIxOa75M322OsG99+7JsBn1YaTxDJ4hSnX0dyheS620HsMFbP1
27LjYFX2mee8jeZN8GIUAdPLDHPkvGnlGfFFvj8f/IKfjAexECrBhlyhyQIVAI+1
CU2hfXqiLDuIPKruy17wrzyVAoGAB7qCoD8vJPq4jMZ77Scv4dfWgz6F+LMImcl8
QOIh+3f3JhJvR9f+hw1MGsg3l/z57GlfgXkqt420vTPI6OghELv/hauFNSExCKqv
kJW+J7Hyoa0sGuf7Ihy9vC6PJnoNkopqqecwpAUUpvKahcZ1uvNnGfRDc5SGmuzn
ZhKHy5ICgYBv94YBWdxGXWwcUKAmJrC+u3Xdnb8t1RY0RcrbKYqQe5Eekza4gh8B
iGdLMBdX3CZlXINJRhsK0UU7E+edEIk+aCtAnFE2+S4zPqtpFGOLIjOQ+i2W5XZv
MOHoxrse7qNvstZRc0BMaEKuKd9DW4wy9JMMZC7xChF8590rCaWA5gIURVR0jghL
lZpwVaJtN6Yo7kUe9S8=
-----END DSA PRIVATE KEY-----
and the public key looks like this:
---- BEGIN SSH2 PUBLIC KEY ----
AAAAB3NzaC1kc3MAAACBAJALAcrcFeVT5RBlEp2f0Ax21AYE66i99UJcpZLdBSrlrWYsOV
E5I/cVnmXCe97lvNze/s465rHFzSs4q1jKSItfPdzwGFSESFbQco/gcA14llnVtkW0yJLO
tWkcpVLrS/XHtY2g6rVwaslUgsiwcNZzXUVK+SNGOeUq1W7a5QTNAAAAFQDldiX11zybDl
qoO6pkBj1ZCZF71QAAAIADiF5K9IxAtmFSMoPE8OylIvrpJHNLtG0Qq8Gh3MS39vnak1tL
ZRu+AcU5LM9v5rliAdKfCZ19Dz8CgRFhBlJjWBc+Sqtd1WIStxVahjYd8hKH0M5ZF0HO/9
u3waBnvjdr745z7ELoBZeV4QTRuNpnAElSYul7HdjVIsciOm1S/gAAAIAJzB2OxPqv2flY
LZxADplI3Ta8STosWIsGg+qrDpJUSZV6oxBhoOdoCUOnmd29+7NzfRcsLaLqGepHYCPu+n
tkgFjZpuSnPROiwEKqjwkQotrppS/hQ+9ooYFYMSkorWXPQU0K3RNmcnM9o69XlIQ7EQW6
FzpC17xBmiIZQRJpAw==
---- END SSH2 PUBLIC KEY ----
To verify that Serv-U works, I tried connecting with Filezilla client. It
converted the private key to Putty format but then it worked. What could be
wrong? Here is an excerpt from my Jsch log:
11:13:25,511 Connecting to localhost port 22
11:13:25,511 Connection established
11:13:25,527 Remote version string: SSH-2.0-Serv-U_10.0.0.7
11:13:25,527 Local version string: SSH-2.0-JSCH-0.1.42
11:13:25,527 CheckCiphers:
aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
11:13:25,808 aes256-ctr is not available.
11:13:25,808 aes192-ctr is not available.
11:13:25,808 aes256-cbc is not available.
11:13:25,808 aes192-cbc is not available.
11:13:25,808 arcfour256 is not available.
11:13:25,808 SSH_MSG_KEXINIT sent
11:13:25,808 SSH_MSG_KEXINIT received
11:13:25,808 kex: server->client aes128-cbc hmac-md5 none
11:13:25,808 kex: client->server aes128-cbc hmac-md5 none
11:13:25,824 SSH_MSG_KEXDH_INIT sent
11:13:25,824 expecting SSH_MSG_KEXDH_REPLY
11:13:25,855 ssh_rsa_verify: signature true
11:13:25,855 Permanently added 'localhost' (RSA) to the list of known hosts.
11:13:25,855 SSH_MSG_NEWKEYS sent
11:13:25,855 SSH_MSG_NEWKEYS received
11:13:25,871 SSH_MSG_SERVICE_REQUEST sent
11:13:25,871 SSH_MSG_SERVICE_ACCEPT received
11:13:25,871 Authentications that can continue:
publickey,keyboard-interactive,password
11:13:25,871 Next authentication method: publickey
11:13:25,886 Authentications that can continue:
publickey,keyboard-interactive,password
11:13:25,886 Next authentication method: publickey
The last two lines repeat forever.
On the Serv-U side the log is as follows:
[02] Wed 23Jun10 11:13:25 - (000004) Connected to 127.0.0.1 (local address
127.0.0.1, port 22)
[03] Wed 23Jun10 11:13:25 - (000004) IP-Name: localhost (127.0.0.1)
[30] Wed 23Jun10 11:13:25 - (000004) SSH2_MSG_USERAUTH_REQUEST: user: user;
service: ssh-connection; type: none
[31] Wed 23Jun10 11:13:25 - (000004) SSH2_MSG_USERAUTH_FAILURE: login failed
[30] Wed 23Jun10 11:13:25 - (000004) SSH2_MSG_USERAUTH_REQUEST: user: user;
service: ssh-connection; type: publickey
[30] Wed 23Jun10 11:13:25 - (000004) SSH2_MSG_USERAUTH_REQUEST: user: user;
service: ssh-connection; type: publickey
[30] Wed 23Jun10 11:13:25 - (000004) SSH2_MSG_USERAUTH_REQUEST: user: user;
service: ssh-connection; type: publickey
The last line repeats forever.
Any suggestions are welcome,
/Bengt
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users