Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20879

SSH Credentials (private key with passphrase) do not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-client-plugin
    • Labels:
    • Environment:
    • Similar Issues:

      Description

      Am I doing something wrong, or is this not something that is supported?

      When I try to add a Git SCM using SSH credentials, it fails with the following error (see SCMError.png):

      	
      Failed to connect to repository : Command "ls-remote -h git@github.com:AppDirect/StandingCloud.git HEAD" returned status code 128:
      stdout: 
      stderr: Permission denied (publickey). 
      fatal: The remote end hung up unexpectedly
      

      I've configured the private key properly (as far as I know anyway)... See PrivateKeyConfiguration.png

      I've also tried the same configuration under a credential domain in case git was hung with a message like this (See CredentialDomain.png):

      The authenticity of host 'github.com (192.30.252.128)' can't be established.
      RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
      Are you sure you want to continue connecting (yes/no)?
      

      I've tested and the private key that I am using does have access:

      [root@jenkins ~]# ssh -T -i /dev/shm/id_rsa git@github.com
      The authenticity of host 'github.com (192.30.252.128)' can't be established.
      RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
      Are you sure you want to continue connecting (yes/no)? yes
      Warning: Permanently added 'github.com,192.30.252.128' (RSA) to the list of known hosts.
      Enter passphrase for key '/dev/shm/id_rsa': 
      Hi nshenry03! You've successfully authenticated, but GitHub does not provide shell access.
      

      As a workaround I can add/create a key as the jenkins user; however, it would be great if I could use the SSH Credentials plugin so that the key is backed up and restored if I move to a new Jenkins server.

        Attachments

          Issue Links

            Activity

            nshenry03 Nick Henry created issue -
            dnozay Damien Nozay made changes -
            Field Original Value New Value
            Summary SSH Credentials do not work to connect to private GitHub repository SSH Credentials (private key with passphrase) do not work
            danielbeck Daniel Beck made changes -
            Link This issue is duplicated by JENKINS-25194 [ JENKINS-25194 ]
            jglick Jesse Glick made changes -
            Component/s git [ 15543 ]
            jglick Jesse Glick made changes -
            Labels ssh
            markewaite Mark Waite made changes -
            Assignee Nicolas De Loof [ ndeloof ]
            markewaite Mark Waite made changes -
            Link This issue is duplicated by JENKINS-27998 [ JENKINS-27998 ]
            markewaite Mark Waite made changes -
            Link This issue is duplicated by JENKINS-20638 [ JENKINS-20638 ]
            markewaite Mark Waite made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            dejayc Dejay Clayton made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            agallardo Alberto Gallardo made changes -
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 152690 ] JNJira + In-Review [ 186170 ]
            markewaite Mark Waite made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Resolved [ 5 ]
            jglick Jesse Glick made changes -
            Link This issue relates to SECURITY-445 [ SECURITY-445 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal CD-150 (Web Link)" [ 19130 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-53134 [ JENKINS-53134 ]
            markewaite Mark Waite made changes -
            Link This issue is duplicated by JENKINS-53134 [ JENKINS-53134 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-53134 [ JENKINS-53134 ]

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              nshenry03 Nick Henry
              Votes:
              20 Vote for this issue
              Watchers:
              35 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: