[英]How to set up ssh key when pulling git repo?
I have things set up on my windows box and now am trying to clone a repo onto my mac machine. 我在Windows框上设置了东西,现在正尝试将存储库克隆到我的Mac机器上。
If the location of a repo is 如果回购的位置是
ssh://git@someplace/someproject.git
when cloning as 当克隆为
git clone ssh://git@someplace/someproject.git folder-name
Where (and how) do i use the SSH PPK? 我在哪里(以及如何)使用SSH PPK?
The issue here is that i am not an admin of someplace
and when prompted for a password, i don't know what it is. 这里的问题是我不是某个
someplace
的管理员,当系统提示输入密码时,我不知道它是什么。 My SSH key however grants me access 但是我的SSH密钥授予我访问权限
The following steps fixed the issue for me 以下步骤为我解决了这个问题
In .ssh/
create a config
file and make sure it contains a path to your PPK 在
.ssh/
创建一个config
文件,并确保它包含您PPK的路径
host someplace
user git
port 22
hostname somehost
identityfile ~/.ssh/your_key
Also, make sure your key's permissions are 700
另外,请确保您的密钥权限为
700
即使您没有将GitHub用作托管站点,其“ 设置Git帮助”页面也将非常有用地回答您的问题。
您无需使用SSH PPK即可从远程计算机进行克隆,而PPK只允许您执行所有操作而不必每次都键入密码。
您必须能够将ssh切换到要从其克隆的盒子(PC),因此该盒子上的git帐户必须能够使用密钥对ssh进入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.