110.16. 设置首选 SFTP 验证方法
如果要显式指定由 sftp
组件使用的身份验证方法列表,请使用 preferredAuthentications
选项。例如,如果您想将 Camel 试图通过私有/公共 SSH 密钥进行身份验证,并在没有公钥时回退到用户/密码身份验证,则使用以下路由配置:
from("sftp://localhost:9999/root?username=admin&password=admin&preferredAuthentications=publickey,password"). to("bean:processFile");
from("sftp://localhost:9999/root?username=admin&password=admin&preferredAuthentications=publickey,password").
to("bean:processFile");