Uploaded image for project: 'FUSE Mediation Router'
  1. FUSE Mediation Router
  2. MR-934

camel-ssh fails with public key authentication since Fuse 6.1 Rollup 1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 2.12.0.redhat-61-xx
    • 2.12.0.redhat-61379
    • None
    • None
    • Hide

      (You'll need a Linux SSH server, which may or may not be on the same host as will run Fuse)

      1. Install Fuse 6.1 GA
      2. Use ssh-keygen on Fuse host to create new rsa key called "test_rsa" (test_rsa.pub will also be generated in the same directory). NOTE: use an empty passphrase when prompted – Camel's SSH support can't handle encrypted keyfiles.
      3. Copy the .pub file to the SSH server, if it isn't the same host that Fuse is running on.
      4. On the SSH server host, add the contents of test_rsa.pub to $HOME/.ssh/authorized_keys

      5. Deploy the following Camel route (e.g., copy to the deploy directory):

      <?xml version="1.0" encoding="UTF-8"?>
      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="eager">
        <camelContext xmlns="http://camel.apache.org/schema/blueprint">
          <route>
            <from uri="timer://something?fixedRate=true&amp;period=2000"/>
            <setBody>
              <constant>ls -l</constant>
            </setBody>
            <to uri="ssh://kevin@192.168.1.50:22?certResource=file:///home/kboone/test_rsa"/>
            <to uri="log:XXX?level=ERROR"/>
          </route>
        </camelContext>
      </blueprint>
      

      Modify the location of the RSA key, the hostname/IP, and user ID as appropriate.

      6. Check that the SSH operation is succeeding by looking in the Fuse log.

      16:07:22,190 | ERROR | timer://something | XXX ... Body: [Body is instance of java.io.InputStream]]

      In fact, anything but a 500-line exception stack probably indicates success.

      7. When it's working, apply patch Rollup 1.

      8. Note that the SSH operation is now failing, with the following exception:

      org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ls -l]
      ...
      Caused by: java.lang.AbstractMethodError: org.apache.sshd.common.keyprovider.AbstractKeyPairProvider.loadKeys()Ljava/lang/Iterable;
              at org.apache.sshd.common.keyprovider.AbstractKeyPairProvider.loadKey(AbstractKeyPairProvider.java:42)[30:org.apache.sshd.core:0.11.0]
              at org.apache.camel.component.ssh.SshEndpoint.sendExecCommand(SshEndpoint.java:115)[252:org.apache.camel.camel-ssh:2.12.0.redhat-610394]
      ...
      
      Show
      (You'll need a Linux SSH server, which may or may not be on the same host as will run Fuse) 1. Install Fuse 6.1 GA 2. Use ssh-keygen on Fuse host to create new rsa key called "test_rsa" (test_rsa.pub will also be generated in the same directory). NOTE: use an empty passphrase when prompted – Camel's SSH support can't handle encrypted keyfiles. 3. Copy the .pub file to the SSH server, if it isn't the same host that Fuse is running on. 4. On the SSH server host, add the contents of test_rsa.pub to $HOME/.ssh/authorized_keys 5. Deploy the following Camel route (e.g., copy to the deploy directory): <?xml version= "1.0" encoding= "UTF-8" ?> <blueprint xmlns= "http: //www.osgi.org/xmlns/blueprint/v1.0.0" default -activation= "eager" > <camelContext xmlns= "http: //camel.apache.org/schema/blueprint" > <route> <from uri= "timer: //something?fixedRate= true &amp;period=2000" /> <setBody> <constant>ls -l</constant> </setBody> <to uri= "ssh: //kevin@192.168.1.50:22?certResource=file:///home/kboone/test_rsa" /> <to uri= "log:XXX?level=ERROR" /> </route> </camelContext> </blueprint> Modify the location of the RSA key, the hostname/IP, and user ID as appropriate. 6. Check that the SSH operation is succeeding by looking in the Fuse log. 16:07:22,190 | ERROR | timer://something | XXX ... Body: [Body is instance of java.io.InputStream] ] In fact, anything but a 500-line exception stack probably indicates success. 7. When it's working, apply patch Rollup 1. 8. Note that the SSH operation is now failing, with the following exception: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: ls -l] ... Caused by: java.lang.AbstractMethodError: org.apache.sshd.common.keyprovider.AbstractKeyPairProvider.loadKeys()Ljava/lang/Iterable; at org.apache.sshd.common.keyprovider.AbstractKeyPairProvider.loadKey(AbstractKeyPairProvider.java:42)[30:org.apache.sshd.core:0.11.0] at org.apache.camel.component.ssh.SshEndpoint.sendExecCommand(SshEndpoint.java:115)[252:org.apache.camel.camel-ssh:2.12.0.redhat-610394] ...

    Description

      A Camel route that uses camel-ssh with public-key authentication to invoke a command on a remote system using SSH fails after applying Rollup 1. The exact same code was working successfully before Rollup 1, and nothing else has changed.

      Attachments

        Activity

          People

            willem.jiang Willem Jiang (Inactive)
            rhn-support-kboone Kevin Boone
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: