Apache camel Camel sftp-对于无密码登录设置-我得到Jsch异常:Auth fail

Apache camel Camel sftp-对于无密码登录设置-我得到Jsch异常:Auth fail,apache-camel,sftp,jsch,camel-ftp,Apache Camel,Sftp,Jsch,Camel Ftp,我正在尝试连接到一个SFTP服务器,我已经为其设置了无密码身份验证。我可以从终端连接到此服务器。但是,当我尝试使用Springboot-Camel SFTP访问服务器时,我遇到了一个异常: 2018-08-29 14:59:24617警告org.apache.camel.component.file.remote.SftpConsumer:自动创建目录时出错:传入到期无法连接到sftp://username@主持人:22。此异常被忽略。 org.apache.camel.component.fi

我正在尝试连接到一个SFTP服务器,我已经为其设置了无密码身份验证。我可以从终端连接到此服务器。但是,当我尝试使用Springboot-Camel SFTP访问服务器时,我遇到了一个异常:

2018-08-29 14:59:24617警告org.apache.camel.component.file.remote.SftpConsumer:自动创建目录时出错:传入到期无法连接到sftp://username@主持人:22。此异常被忽略。 org.apache.camel.component.file.GenericFileOperationFailedException:无法连接到sftp://username@主持人:22

原因:com.jcraft.jsch.JSchException:Auth fail 位于com.jcraft.jsch.Session.connect(Session.java:519) 位于org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:116) ... 省略了33个公共框架

这是我的路线的终点: 文件终结点:sftp://username@host.net/incoming?streamDownload=true&noop=true&disconnect=true&stepwise=false&useList=false&fileName=abc.txt&ignoreFileNotFoundOrPermissionError=false&sendpemptymessagewhenidle=true&privateKeyPassphrase=XXX&preferredAuthentications=publickey&privateKeyFile=/Users/username/.ssh/id\u rsa&scheduler=spring&scheduler.cron=0+0/1++++


任何帮助都将不胜感激。谢谢

简单回答:添加用户名和密码,即使密码可能为空


长答覆: 我有好几条工作路线
username=something&password=&privateKeyPassphrase=XXX&preferredAuthentications=publickey&privateKeyFile=id\u rsa

顺便说一句,您的私钥的路径让我感到焦虑,默认情况下,在linux上,本地用户可以使用本地文件作为私有ssh密钥,只有密钥是“chmod 400”或类似的密钥。请检查您的Karaf或Servicemix实例是否能够正确读取此路径

此外,您还可以看到整个sFTP训练,包括

log4j.logger.org.apache.camel.component.file.remote.SftpOperations = ON

从文件名来看,我假设有一个RSA密钥——请确保是这样。我在使用ed25519密钥时遇到了JSch问题

此外,在我设置的SFPT路由中,我在URI中不使用“user@”;我只是

 sftp://some.host/directory?username=someone?privateKeyFile=<>[..options..]
sftp://some.host/directory?username=someone?privateKeyFile=[…选项]
但我不包括fliot所指示的空白密码属性

最后,您可以尝试检查目标服务器的sshd日志;它可能有一些有用的东西