Jenkins: what is the correct format for private key in Credentials

前端 未结 6 1803
难免孤独
难免孤独 2020-11-22 07:16

I\'m creating a job in Jenkins 2.152 running on Windows Server 2016 which needs to pull from a git repo hosted on bitbucket.org. I tested the ssh key through git-bash so I k

6条回答
  •  孤城傲影
    2020-11-22 07:50

    I also got this error message and eventually found out that the Jenkins credential should be RSA secret key, not public key. Below is my steps for configuring Jenkins to clone from bitbucket:

    1. Add credential in Jenkins credentials
       Kind: SSH username and private key
       Scope: Global
       Username: 
       Private key: 
             -----BEGIN RSA PRIVATE KEY-----
             ......
             -----END RSA PRIVATE KEY-----
    
    1. Create a job and configure the repository path and credential as following:

提交回复
热议问题