camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: Can't get scp to work
Date Mon, 20 Jun 2016 18:07:01 GMT
I just tried the same thing on a linux machine (redhat), and got exactly the same error. But
then, when I tried privateKeyFile (not documented on the scp/Jsch camel page) instead of username/password,
to make it use private key verification, then it just worked on the first attempt (private
key verification was already setup between these servers). A bit strange that something as
simple as username and password verification doesn't work, but something more complicated
works right away.

Anyway, since private key verification was my final goal, I think I will settle with this
and not really investigate further. :)


-----Original Message-----
From: [] 
Sent: Monday, June 20, 2016 12:34 PM
Subject: Can't get scp to work


I'm trying to setup a simple (in my eyes) file transfer between servers, and when configuring
this I am trying to transfer files from my windows machine to a remote server. But I simply
can't get it to work.

The route looks like this:

                         <from uri="file:{{inputDirectory}}?include=(?i).*\.*&amp;delete=true&amp;delay=5000&amp;filter=#fileFilter"
                         <to uri="scp://our-server/tmp/?username=user&amp;password=password&amp;strictHostKeyChecking=no"
/> </route>

First, it complained about the missing file C:\Users\username\.ssh\known_hosts. When I created
that file and tried again, it complains about "Auth cancel".

Here is the stacktrace:

2016-06-20 10:05:50,926 [Camel (camel-1) thread #0] WARN  org.apache.camel.component.scp.ScpOperations
- Could not create ssh session for scp://user@our-server:22 com.jcraft.jsch.JSchException:
Auth cancel
                         at com.jcraft.jsch.Session.connect(
                         at org.apache.camel.component.scp.ScpOperations.createSession(
                         at org.apache.camel.component.scp.ScpOperations.connect(
                         at org.apache.camel.component.file.remote.RemoteFileProducer.connectIfNecessary(
                         at org.apache.camel.component.file.remote.RemoteFileProducer.recoverableConnectIfNecessary(
                         at org.apache.camel.component.file.remote.RemoteFileProducer.preWriteCheck(
                         at org.apache.camel.component.file.GenericFileProducer.processExchange(
                         at org.apache.camel.component.file.remote.RemoteFileProducer.process(

In the code for com.jcraft.jsch.Session I see that the original JSchAuthCancelException is
caught and swallowed (except setting auth_cancel=true) on line 471. But when debugging this
in Eclipse I get some more information about the error. For example I can see that the message/method
is "keyboard-interactive", the kex is of the type com.jcraft.jsch.DHG14 and it's key_alg_name
is "ssh-rsa". Maybe this says something important to someone. But the thing that sticks out
for me is that the javadoc for DHG14 (
specifically says "Usually not to be used by applications", which could be an indication that
the wrong KeyExchange type is used, right? The javadoc also says that it "Implements the key
exchange method diffie-hellman-group1-sha1, using the Oakley Group 14".

Is it possible to make Camel use a different KeyExchange type? I can't find any documentation
about this. In fact, the scp support in Camel is not really documented much at all, if you
ask me.

If it is not possible to change the KeyExchange type, what other options to I have to make
scp work?

I use Camel 2.17.0, and sftp with the same server, username and password works just fine.


View raw message