我想将 Jenkins 与 Bitbucket 上的存储库一起使用。为此,我使用 userjenkins
和 command创建了一个 ssh 密钥ssh-keygen -t rsa -C "my_email"
。我在 Bitbucket 上添加了公钥,我可以使用git clone ...
.
但是当我在 Jenkins 中配置项目时,我把 urlgit@bitbucket.org:my_username/my_repository.git
这是错误:
Failed to connect to repository : Command "git ls-remote -h git@bitbucket.org:skurty/ma-carte-augmentee-bo.git HEAD" returned status code 128:
stdout:
stderr: ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
如果我执行 ssh git@bitbucket.org,我会得到:
PTY allocation request failed on channel 0
conq: logged in as my_username.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
Connection to bitbucket.org closed.
我还尝试创建文件~/.ssh/authorized_keys
并将公钥放入其中,但同样的问题。
我还用sudo /etc/init.d/jenkins restart
谢谢您的帮助 :)
PS:我在 Debian Squeeze 64 位