Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-446

SSH agent authentication is no longer working in wagon-ssh 2.10

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.10
    • None
    • wagon-ssh
    • None

    Description

      After upgrading to wagon-2.10, SSH Agent authentication doesn't seems to work anymore. I got the following error when trying to publish a site, using maven-site-plugin 3.4:

      Using private key: <PATH TO id_rsa>
      : Error uploading site: Cannot connect. Reason: Auth fail -> [Help 1]

      I have no server for this site defined in my settings.xml

      After some investigation, I suspect that the cause is WAGON-413 since the logic in AbstractJschWagon was changed to not use the agent if ScpHelper.getPrivateKey() returns a File.

      Unfortunate, ScpHelper.getPrivateKey() seems to have a fallback behavior that always returns the id_rsa key (if one exists) even when no matching server element exists in settings.xml and the effect is that the agent is never consulted.

      The authentication will then fail since no server element provides a key password.

      My current workaround is to set the wagon.privateKeyDirectory System Property to an empty directory. This will prevent the ScpHelper.getPrivateKey() fallback to kick in.

      Has anybody else got SSH agent working in combination with existing id_rsa files?

      Attachments

        1. wagon-446.patch
          0.8 kB
          Per Landberg

        Activity

          People

            Unassigned Unassigned
            perlan Per Landberg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: