Jenkins git访问拒绝
![](https://upload.jianshu.io/users/upload_avatars/7293472/80c6aed5-02ce-42ca-af0b-bd0c305a0317.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/96/h/96/format/webp)
问题一
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