Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
SSHAvailable as of Camel 2.10 The SSH component enables access to SSH servers such that you can send an SSH command, and process the response. Maven users will need to add the following dependency to their <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-ssh</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency> URI formatssh:[username[:password]@]host[:port][?options] Options
Consumer Only Options
Usage as a Producer endpointWhen the SSH Component is used as a Producer ( Here is an example of this within the XML DSL. Note that the command has an XML encoded newline ( <route id="camel-example-ssh-producer"> <from uri="direct:exampleSshProducer"/> <setBody> <constant>features:list </constant> </setBody> <to uri="ssh://karaf:karaf@localhost:8101"/> <log message="${body}"/> </route> AuthenticationThe SSH Component can authenticate against the remote SSH server using one of two mechanisms: Public Key certificate or username/password. Configuring how the SSH Component does authentication is based on how and which options are set.
The following route fragment shows an SSH polling consumer using a certificate from the classpath. In the XML DSL, <route> <from uri="ssh://scott@localhost:8101?certResource=classpath:test_rsa&useFixedDelay=true&delay=5000&pollCommand=features:list%0A"/> <log message="${body}"/> </route> In the Java DSL, from("ssh://scott@localhost:8101?certResource=classpath:test_rsa&useFixedDelay=true&delay=5000&pollCommand=features:list%0A") .log("${body}"); An example of using Public Key authentication is provided in Certificate DependenciesYou will need to add some additional runtime dependencies if you use certificate based authentication. The dependency versions shown are as of Camel 2.11, you may need to use later versions depending what version of Camel you are using. <dependency> <groupId>org.apache.sshd</groupId> <artifactId>sshd-core</artifactId> <version>0.8.0</version> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcpg-jdk15on</artifactId> <version>1.47</version> </dependency> <dependency> <groupId>org.bouncycastle</groupId> <artifactId>bcpkix-jdk15on</artifactId> <version>1.47</version> </dependency> ExampleSee the |