简体   繁体   English

无法使用ssh通过Concourse克隆git存储库

[英]Cannot use ssh to clone git repository with Concourse

We are using a Concourse instance deployed to and EC2 instance using docker-compose, as outlined here . 我们使用的是大堂的实例部署和使用泊坞窗,撰写EC2实例,如概述这里

Things are mostly working well. 大部分情况下运行良好。 However, we can't seem to clone git resources using SSH. 但是,我们似乎无法使用SSH克隆git资源。 We get this error: 我们得到这个错误:

resource script '/opt/resource/check []' failed: exit status 128

stderr:
Identity added: /tmp/git-resource-private-key (/tmp/git-resource-private-key)
Cloning into '/tmp/git-resource-repo-cache'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

We've used Concourse in the past, so we're reasonably sure that we have the resource configured correctly, but I've attached a sample as well. 过去我们使用过Concourse,因此可以合理地确定我们已经正确配置了资源,但是我还附加了一个示例。

- name: vision_build
  type: git
  source:
    private_key: |
      -----BEGIN RSA PRIVATE KEY-----
      ***************************
      -----END RSA PRIVATE KEY-----
    uri: git@github.com:someorg/someapp.git

Cloning works correctly with username/password authentication, but we'd like to use read only deploy keys. 克隆可以正确使用用户名/密码身份验证,但是我们希望使用只读部署密钥。

Another symptom that we are seeing is the inability to hijack our jobs. 我们看到的另一个症状是无法劫持我们的工作。 It's unclear if they are connected, but seems possible given that they both have to do with SSH. 目前尚不清楚它们是否已连接,但鉴于它们都与SSH有关,因此似乎可行。 Hijack comes back with this message: 劫机返回此消息:

error: websocket: bad handshake

Upgrading my comment to an answer. 将我的评论升级为答案。

is your private key's corresponding puiblic key configured on the github side under someorg/someapp ? 您的私钥的对应公共密钥是在someorg / someapp下的github侧配置的吗? Either as a deployment key, or as a user in your org dedicated to that activity? 是作为部署密钥,还是作为组织中专用于该活动的用户? Sounds to me like you didn't add access for the key in github. 在我看来,您没有在github中添加密钥访问权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM