[英]ruby on rails git permission denied
I am following this guide to set ruby on rails environment on my Mac El Captain. 我正在按照本指南在Mac El Captain上的Ruby on Rails环境中进行设置。
I followed upto installing homebrew, ruby latest version 2.2.3 with rbenv. 我继续使用rbenv安装homebrew,ruby最新版本2.2.3。 Now, I was setting up git.
现在,我正在设置git。
Followed up first few commands 跟进前几个命令
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"
Now, I have been asked to save the generated key. 现在,我被要求保存生成的密钥。 I saved it to
~
directory with a name file
. 我将其保存到带有名称
file
~
目录中。 I have now two files namely file
and file.pub
. 我现在有两个文件,分别是
file
和file.pub
。
I went to this link to copy ssh key. 我去了这个链接复制ssh密钥。 I clicked on Add SSH key option there.
我单击了添加SSH密钥选项。 Named the key ROR SSH Key .
命名为密钥ROR SSH密钥 。
The key in file.pub
looks like file.pub
的密钥看起来像
ssh-rss asfjasfhjalsfdhaskfdhalsdfsdf\\asdf\\as\\dg\\sa\\fasdfas\\f\\asdf---so on random numbers---adfasdfasfa myemail@gmail.com ssh-rss asfjasfhjalsfdhaskfdhalsdfsdf \\ asdf \\ as \\ dg \\ sa \\ fasdfas \\ f \\ asdf ---依随机数--- adfasdfasfa myemail@gmail.com
and I pasted the key there in github and saved the key. 然后将密钥粘贴到github中,然后保存密钥。
Then, I went back to terminal and typed the below command. 然后,我回到终端并输入以下命令。
ssh -T git@github.com
but I didn't received any message saying " Hi excid3! You've successfully authenticated, but GitHub does not provide shell access. " 但是我没有收到任何消息“ 嗨,excid3!您已经成功通过身份验证,但是GitHub不提供shell访问。 ”
I got a message saying 我收到一条消息说
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).
Here above I have change few characters in SHA256 key. 上面我在SHA256键中更改了几个字符。 Just for security.
只是为了安全。 Also, I have changed IP address a little bit for the same.
另外,我对IP地址做了一些更改。 But, the idea behind it is same.
但是,其背后的想法是相同的。
Please guide me what's wrong. 请指导我怎么了。 Thanks.
谢谢。
By default, ssh
will look in the ~/.ssh
folder for your private keys. 默认情况下,
ssh
将在~/.ssh
文件夹中查找您的私钥。 Since you saved it in ~
instead, it can't find it. 由于您将其保存在
~
,因此找不到它。
You can either: 您可以:
file
and file.pub
files into ~/.ssh
and rename to id_rsa
and id_rsa.pub
, as OS X will automatically use those files for any ssh
command (if you hadn't manually entered a filename, this is where ssh-keygen
would have saved them). file
和file.pub
文件移动到~/.ssh
并重命名为id_rsa
和id_rsa.pub
,因为OS X会自动将这些文件用于任何ssh
命令(如果您没有手动输入文件名,则ssh-keygen
可以保存它们)。 ssh-add -K file
command to permanently add your key to the OS X Keychain. ssh-add -K file
命令将密钥永久添加到OS X钥匙串。 Note that GitHub's own instructions say they "strongly suggest keeping the default settings" instead of saving the private/public key somewhere else. 请注意, GitHub自己的说明说,他们“强烈建议保留默认设置”,而不是将私钥/公钥保存在其他位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.