[英]Using SSH Keys on different Mac
I have GIT and my repos setup on a MacBook Air. 我在MacBook Air上安装了GIT和存储库。 I'm trying to clone the repo on my iMac. 我正在尝试在iMac上克隆存储库。 My understanding was that I needed to copy my key over from the /.ssh folder on the MBA to the same folder iMac. 我的理解是,我需要将密钥从MBA的/.ssh文件夹复制到同一文件夹iMac。
However, when I try and clone the repo on the iMac, I get the following error: 但是,当我尝试在iMac上克隆存储库时,出现以下错误:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I've done a little research already and have verified that... 我已经做了一些研究,并证实了...
I have the latest version of GIT and that my user.name and user.email variables are configured correctly. 我拥有最新版本的GIT,并且正确配置了user.name和user.email变量。 ( New Mac - new SSH keys for github? ) ( 新Mac-github的新SSH密钥? )
the ownership & permissions on the .gitconfig file and parent folder are r/w and owned by my user. .gitconfig文件和父文件夹的所有权和权限为r / w,由我的用户拥有。 ( Trouble setting up Tower with my GitHub Account - error: could not lock config file ) ( 无法使用我的GitHub帐户设置Tower-错误:无法锁定配置文件 )
my $HOME environment variable points to my users working directory. 我的$ HOME环境变量指向我的用户工作目录。 ( Trouble setting up git with my GitHub Account error: could not lock config file ) ( 无法通过我的GitHub帐户设置git时出错:无法锁定配置文件 )
At this point, I am all out of ideas and could really use some advice. 在这一点上,我完全没有想法,可以真正使用一些建议。
Suggestions? 建议?
Thanks! 谢谢!
Can't believe I found the solution right after I got done posting this, but for those who are copying keys to new machines, you have to let SSH know the keys are there. 我不敢相信我在完成发布后立即找到了解决方案,但是对于那些将密钥复制到新计算机上的人,您必须让SSH知道密钥在那里。 See this answer for details: 有关详细信息,请参见以下答案:
https://stackoverflow.com/a/12100237/337824 https://stackoverflow.com/a/12100237/337824
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.