【发布时间】:2015-10-14 02:15:30
【问题描述】:
我正在按照this 指南在我的 Mac El Captain 上设置 ruby on rails 环境。
我随后安装了自制软件,使用 rbenv 安装了 ruby 最新版本 2.2.3。现在,我正在设置 git。
跟进前几个命令
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
ssh-keygen -t rsa -C "YOUR@EMAIL.com"
现在,我被要求保存生成的密钥。我将它保存到名为file 的~ 目录中。我现在有两个文件,即file 和file.pub。
我去this链接复制ssh密钥。我在那里点击了 Add SSH key 选项。将密钥命名为 ROR SSH 密钥。
file.pub 中的键看起来像
ssh-rss asfjasfhjalsfdhaskfdhalsdfsdf\asdf\as\dg\sa\fasdfas\f\asdf---so on random numbers---adfasdfasfa myemail@gmail.com
我将密钥粘贴到 github 中并保存了密钥。
然后,我回到终端并输入以下命令。
ssh -T git@github.com
但我没有收到任何消息“您好 excid3!您已成功验证,但 GitHub 不提供 shell 访问权限。”
我收到一条消息说
The authenticity of host 'github.com (192.30.251.130)' can't be established.
RSA key fingerprint is SHA256:nThbg6sdfgdfgsdfgGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.251.130' (RSA) to the list of known hosts.
Permission denied (publickey).
在上面我更改了 SHA256 密钥中的几个字符。只是为了安全。另外,我也稍微改变了IP地址。但是,它背后的想法是一样的。
请指导我出了什么问题。谢谢。
【问题讨论】:
-
尝试在终端输入
ssh-add并再次推送 -
@matanco 你能重新编写我需要在终端中编写的完整命令吗?
-
这是命令:
ssh-add然后再试一次你所做的。 -
@matanco 我在终端中输入了
ssh-add,然后再次尝试了ssh -T git@github.com。我的权限被拒绝(公钥) -
我建议阅读 ssh 密钥是如何工作的,它们默认存储在哪里。通过使用非默认值,您为自己做了很多额外的工作。
标签: ruby-on-rails ruby git macos ssh