2017-08-08 220 views
1

得到这个错误,而设置在源代码管理部分的混帐配置,存储库URL是私人这样exampleip:/home/project/git-repo/single_login.git不从GitHub詹金斯的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. 

我试图在詹金斯的证书设置了用户名和密码提供者,但仍然不起作用。

,我为在终端项目做克隆是这样git clone [email protected]:/home/project/git-repo/single_login.git这个要求,一旦提供它的工作原理

我认为不知何故,他被输入查询的用户名/密码以错误的方式的密码,任何人有一个关于这个的想法?

回答

1

一个类似于scp的ssh URL exampleip:/home/project/git-repo/single_login.git表示运行jenkins的帐户将查找an ~/.ssh/config file,其中Host exampleip条目。

Host exampleip 
    HostName exampleip.ip 
    User username 
    IdentityFile /path/to/id_rsa_username 

确保id_rsa_username.pub注册到远程服务器例如在~username/.ssh/authorized_keys。然后它会工作。

但是您需要确保谁在运行Jenkins,以便将~/.ssh/config文件设置在正确的位置。

+0

感谢这个配置在〜/ .ssh/config文件与用户jenkins我能够连接到服务器 – jbrunoxd