在“源代码管理”部分中设置git config时遇到此错误,存储库网址是私有的,exampleip:/home/project/git- repo/single_login.git而不是来自github
exampleip:/home/project/git- repo/single_login.git
Failed to connect to repository : Command "git ls-remote -h exampleip:/home/project/git-repo/single_login.git HEAD" returned status code 128: stdout: stderr: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
我尝试在jenkins凭证提供程序中设置用户名和密码,但仍然无法正常工作。
我在终端中为该项目所做的克隆就是这样的,git clone username@exampleip:/home/project/git- repo/single_login.git要求提供密码后就可以使用了
git clone username@exampleip:/home/project/git- repo/single_login.git
我认为他以某种错误的方式输入了用户名/通行证,有人对此有想法吗?
类似scp的ssh URL exampleip:/home/project/git-repo/single_login.git意味着运行Jenkins的帐户将查找带有条目的~/.ssh/config文件Hostexampleip。
exampleip:/home/project/git-repo/single_login.git
~/.ssh/config
Hostexampleip
Host exampleip HostName exampleip.ip User username IdentityFile /path/to/id_rsa_username
确保id_rsa_username.pub已在处注册到远程示例服务器~username/.ssh/authorized_keys。然后它将起作用。
id_rsa_username.pub
~username/.ssh/authorized_keys
但是您需要确定谁在运行Jenkins,以便将~/.ssh/config文件设置在正确的位置。