简体   繁体   English

Jenkins 无法连接 GIT 存储库:权限被拒绝(公钥、gssapi-keyex、gssapi-with-mic、密码)

[英]Jenkins unable to connect GIT repository: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

Hi my Jenkins instance is unable to connect to GIT repository although I googled a lot.嗨,我的 Jenkins 实例无法连接到 GIT 存储库,尽管我搜索了很多。 Both Jenkins and GIT were installed on same CentOS server. Jenkins 和 GIT 都安装在同一个 CentOS 服务器上。 This is the screenshot I got during pipeline set up:这是我在管道设置期间得到的屏幕截图:

在此处输入图片说明

I have done following:我做了以下工作:

  1. Make sure .ssh directory of GIT is of mode 700;确保git的.ssh目录为700模式;
  2. Make sure .ssh/authorized_keys of GIT is of mode 600;确保 GIT 的 .ssh/authorized_keys 为模式 600;
  3. Added Jenkins public key to .ssh/authorized_keys of GIT;将Jenkins公钥添加到GIT的.ssh/authorized_keys;
  4. Log in as Jenkins and execute 'git ls-remote -h :test.git HEAD' on command line - it will prompt for git password;以 Jenkins 身份登录并在命令行上执行 'git ls-remote -h :test.git HEAD' - 它会提示输入 git 密码;
  5. Added git username/password to Jenkins under Credentials在 Credentials 下为 Jenkins 添加了 git 用户名/密码

Jenkins will not use the SSH Keys located on the master or slave that runs the job. Jenkins 不会使用位于运行作业的主站或从站上的 SSH 密钥。 So your setup with placing the keys in ~/.ssh and having a username/password credential set up on on the master will not work.因此,将密钥放在~/.ssh并在主服务器上设置用户名/密码凭据的设置将不起作用。

Instead you should create a set of credentials using the SSH Credential Plugin , where you can also specify the passphrase for the private key.相反,您应该使用SSH Credential Plugin创建一组凭证,您还可以在其中指定私钥的密码。 The jobs then need to use this credential to connect to the repository.然后,作业需要使用此凭据连接到存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Git权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic)? - Git Permission denied (publickey,gssapi-keyex,gssapi-with-mic)? 权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic,密码)。 在git中 - Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). in git Jenkins 权限被拒绝(公钥、gssapi-keyex、gssapi-with-mic、密码) - Jenkins Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password) OpenShift中的权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic) - Permission denied (publickey,gssapi-keyex,gssapi-with-mic) in OpenShift openshift 上的权限被拒绝(publickey、gssapi-keyex、gssapi-with-mic) - Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on openshift 无法再SSH到EC2实例:权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic) - Cannot ssh into EC2 instance anymore: Permission denied (publickey,gssapi-keyex,gssapi-with-mic) Git | 詹金斯| 权限被拒绝(公钥) - Git | Jenkins | Permission denied (publickey) Jenkins Pipeline基于groovy:无法推入git => Permission denied(publickey) - Jenkins Pipeline based on groovy : unable to push into git => Permission denied (publickey) Windows 上的 Git [权限被拒绝(公钥)] 的 Jenkins 问题 - Jenkins issue with Git [Permission denied (publickey).] on Windows git Permission denied(publickey),在每个连接上 - git Permission denied (publickey), on every connect
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM