1、jenkins创建job 连接github时, git的选项,添加repository url后,总是出现
‘ Command "git ls-remote -h git@github.com:.git HEAD" returned status code 128:
stdout:
stderr: Permission denied (publickey).
fatal: Could not read from remote repository.
.’
以上错误,(Credentials中输入了正确的用户名和密码)
2、在本地终端执行:git ls-remote -h git@github.com:.git
执行成功。
3、已经将本地连接github的.ssh文件拷贝到.jenkins/下
都没能成功连接上github,真心求教,望不吝指教!
主要看下本地终端执行git命令的用户和jenkins启动用户是不是相同。
jenkins的启动的默认用户是jenkins用户,可以在jenkins的配置文件修改。