即使设置了正确的ssh密钥,Jenkins git pull也会失败

时间:2018-10-30 13:54:22

标签: git jenkins ssh bitbucket

我仍然通过Jenkins收到SSH git的身份验证错误。我已经完成了:

  1. 以root用户身份登录服务器,向用户:Jenkins授予/ var / www / project文件夹访问权限
  2. 将用户更改为Jenkins
  3. 生成RSA密钥对
  4. 加载ssh代理并使用ssh-添加私钥
  5. 将公钥信息添加到〜/ .ssh / authorized_keys
  6. 将〜/ .ssh设置为700,并将authorized_keys设置为644
  7. 将公共密钥添加到bitbucket ssh密钥
  8. 在Jenkins门户上添加了凭据,以使用私钥创建SSH用户名
  9. 直接将私钥输入上述凭据
  10. 设置源代码管理以指向ssh git并选择上面的ssh凭据(此处没有错误)
  11. 开始构建,但遇到错误。

      

    在工作区中构建/ var / lib / jenkins / workspace / sample-project   git rev-parse --is-inside-work-tree#超时= 10   从远程Git存储库中获取更改   git config remote.origin.url git@bitbucket.org:user / sample-project.git#超时= 10   从git@bitbucket.org获取上游更改:user / sample-project.git   git --version#超时= 10   使用GIT_SSH设置凭据   git fetch --tags --progress git@bitbucket.org:user / sample-project.git + refs / heads / :refs / remotes / origin /   git rev-parse refs / remotes / origin / master ^ {commit}#timeout = 10   git rev-parse refs / remotes / origin / origin / master ^ {commit}#timeout = 10   检出修订版602b327b289f58dccccff7d6b608cb71ae461cce(引用/远程处理/来源/主数据)   git config core.sparsecheckout#超时= 10   git checkout -f 602b327b289f58dccccff7d6b608cb71ae461cce   提交消息:“詹金斯测试”   git rev-list --no-walk 602b327b289f58dccccff7d6b608cb71ae461cce#timeout = 10   [WeEat-Hybrid] $ / bin / sh -xe /tmp/jenkins1258078229157091527.sh

         
        
    • cd / var / www / sample / sample-project
    •   
    • git pull   git@bitbucket.org:权限被拒绝(公钥)。   致命:无法从远程存储库读取。
    •   
         

    请确保您具有正确的访问权限   并且存储库存在。   构建步骤“执行外壳”将构建标记为失败   完成:失败

0 个答案:

没有答案