首页 > 其他分享 >Jenkins git访问拒绝

Jenkins git访问拒绝

时间:2022-11-23 18:14:16浏览次数:65  
标签:git Permission 访问 ssh key denied Jenkins

Jenkins git访问拒绝

Mikasa___ 2018.07.31 14:36:31字数 196阅读 4,649

问题一

Failed to connect to repository : Command "git ls-remote -h [email protected]:xxx/dev_test.git HEAD" returned status code 128:

stdout:

stderr: Permission denied, please tryagain.

Permission denied, please try again.

Permission denied(publickey,gssapi-keyex,gssapi-with-mic,password).

fatal: The remote end hung up unexpectedly

原因:没有配置git的ssh key。

解决方法:执行下面的命令,生成key

ssh-keygen -t rsa -C "[email protected]"

然后将~/.ssh/目录下的id_rsa.pub中的公钥,放到git的ssh key中。再在Jenkins中创建新的Credentials。类型是SSH Username with private key。Username使用ssh-keygen中用到的邮箱,Private Key中选择“From the Jenkins master ~/.ssh”即可。

修改后,问题解决。

标签:git,Permission,访问,ssh,key,denied,Jenkins
From: https://www.cnblogs.com/xkcp008/p/16919315.html

相关文章