简体   繁体   English

Git 无法通过 ssh 部署程序克隆项目

[英]Git can't clone project via ssh Deployer

I'm using Deployer to clone a project onto a server, but despite setting up the deploy key, for some reason cloning via SSH is failing:我正在使用 Deployer 将项目克隆到服务器上,但尽管设置了部署密钥,但由于某种原因,通过 SSH 克隆失败:

ERROR: Repository not found.
fatal: Could not read from remote repository.

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

Steps I've taken:我采取的步骤:

  1. Generate new key on the server where I'm cloning my project: ssh-keygen -t rsa -b 4096 -C "your_email@example.com" , my key file is in this forat: form_simple_id_rsa and of course the pub version too.在我正在克隆我的项目的服务器上生成新密钥: ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ,我的密钥文件在这个格式中: form_simple_id_rsa ,当然还有 pub 版本。
  2. Did eval and added the key: ssh-add -k ~/.ssh/form_simple_id_rsa进行了eval并添加了密钥: ssh-add -k ~/.ssh/form_simple_id_rsa
  3. Tested the connection and all good here.测试了连接,一切都很好。
  4. Added the form_simple_id_rsa.pub key to my repository as a deploy key, the repo owner isn't my account, I'm a collab on this repo, but the server's key is linked to the project so it should be able to clone.form_simple_id_rsa.pub密钥添加到我的存储库作为部署密钥,存储库所有者不是我的帐户,我是此存储库的协作者,但服务器的密钥已链接到项目,因此它应该能够克隆。
  5. Setup deployer in my project to use my host, port, and the new key I made (because there are a few keys), etc:在我的项目中设置部署程序以使用我的主机、端口和我制作的新密钥(因为有几个密钥)等:
host('project')
    ->port(myport)
    ->identityFile('~/.ssh/form_simple_id_rsa')
    ->stage('production')
    ->set('repository', 'git@github.com:company/project.git')
    ->user('root')
    ->set('deploy_path', '/var/www/path');
  1. Tried deploying, get an exit code with an error:尝试部署,得到一个错误的退出代码:
Exit Code: 128(Invalid exit argument)

Saying that the ssh -A -tt command failed.ssh -A -tt命令失败。

If this is not a DEployer version issue ( as in here ), I would try:如果这不是 DEployer 版本问题(如此处),我会尝试:

  • generating and testing a key without a passphrase (to avoid the ssh-add step , making sure there is no passphrase required)生成和测试没有密码的密钥(为了避免ssh-add step ,确保不需要密码)
  • generating a key using -m PEM , to use the old PEM format instead of the new OPENSSH one, in case it has any effect使用-m PEM生成密钥,以使用旧的 PEM 格式而不是新的 OPENSSH 格式,以防它有任何影响

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

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