SSH

Execute commands on remote hosts using SSH.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-ssh-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 32 options, which are listed below.

Name Description Default Type

camel.component.ssh.auth-timeout

Sets the authentication timeout in milliseconds.

Long

camel.component.ssh.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.ssh.bridge-error-handler

Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.

false

Boolean

camel.component.ssh.cert-resource

Sets the resource path of the certificate to use for Authentication. Will use ResourceHelperKeyPairProvider to resolve file based certificate, and depends on keyType setting.

String

camel.component.ssh.cert-resource-password

Sets the password to use in loading certResource, if certResource is an encrypted key.

String

camel.component.ssh.channel-open-timeout

Sets the timeout in milliseconds for opening a channel.

Long

camel.component.ssh.channel-type

Sets the channel type to pass to the Channel as part of command execution. Defaults to exec.

exec

String

camel.component.ssh.ciphers

Comma-separated list of allowed/supported ciphers in their order of preference.

String

camel.component.ssh.client-builder

Instance of ClientBuilder used by the producer or consumer to create a new SshClient. The option is a org.apache.sshd.client.ClientBuilder type.

ClientBuilder

camel.component.ssh.compressions

Whether to use compression, and if so which.

String

camel.component.ssh.configuration

Component configuration. The option is a org.apache.camel.component.ssh.SshConfiguration type.

SshConfiguration

camel.component.ssh.connect-timeout

Sets the socket connection timeout in milliseconds.

Long

camel.component.ssh.enabled

Whether to enable auto configuration of the ssh component. This is enabled by default.

Boolean

camel.component.ssh.fail-on-unknown-host

Specifies whether a connection to an unknown host should fail or not. This value is only checked when the property knownHosts is set.

false

Boolean

camel.component.ssh.health-check-consumer-enabled

Used for enabling or disabling all consumer based health checks from this component

true

Boolean

camel.component.ssh.health-check-producer-enabled

Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.

true

Boolean

camel.component.ssh.heartbeat-interval

Sets the heartbeat interval in milliseconds. If positive, the component will send keep-alive messages to prevent the SSH session from timing out.

Long

camel.component.ssh.heartbeat-reply-max-wait

Sets the maximum number of keep-alive messages without reply before the session is terminated.

Integer

camel.component.ssh.idle-timeout

Sets the timeout in milliseconds to wait before the SSH session is closed due to inactivity. The default value is 0, which means no idle timeout is applied.

Long

camel.component.ssh.kex

Comma-separated list of allowed/supported key exchange algorithms in their order of preference.

String

camel.component.ssh.key-pair-provider

Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server. The option is a org.apache.sshd.common.keyprovider.KeyPairProvider type.

KeyPairProvider

camel.component.ssh.key-type

Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(…​) will be passed this value. From Camel 3.0.0 / 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default.

String

camel.component.ssh.known-hosts-resource

Sets the resource path for a known_hosts file

String

camel.component.ssh.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.ssh.macs

Comma-separated list of allowed/supported message authentication code algorithms in their order of preference. The MAC algorithm is used for data integrity protection.

String

camel.component.ssh.password

Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null.

String

camel.component.ssh.poll-command

Sets the command string to send to the remote SSH server during every poll cycle. Only works with camel-ssh component being used as a consumer, i.e. from(ssh://…​) You may need to end your command with a newline, and that must be URL encoded %0A

String

camel.component.ssh.shell-prompt

Sets the shellPrompt to be dropped when response is read after command execution

String

camel.component.ssh.signatures

Comma-separated list of allowed/supported signature algorithms in their order of preference.

String

camel.component.ssh.sleep-for-shell-prompt

Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds.

100

Long

camel.component.ssh.timeout

Sets the timeout in milliseconds to wait in establishing the remote SSH server connection. Defaults to 30000 milliseconds.

30000

Long

camel.component.ssh.username

Sets the username to use in logging into the remote SSH server.

String