简体   繁体   English

git权限被拒绝

[英]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 . 我现在有两个文件,分别是filefile.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: 您可以:

  1. Move the 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). filefile.pub文件移动到~/.ssh并重命名为id_rsaid_rsa.pub ,因为OS X会自动将这些文件用于任何ssh命令(如果您没有手动输入文件名,则ssh-keygen可以保存它们)。
  2. Use the 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.

相关问题 删除文件在Rails的生产ruby中被拒绝的权限 - Delete file Permission denied in production ruby on rails Ruby on Rails AWS Cap部署权限被拒绝 - Ruby on Rails AWS Cap Deploy Permission Denied 权限被拒绝@dir_initialize Ruby on rails - Permission denied @ dir_initialize Ruby on rails Ruby on Rails权限被拒绝-/root/.bundle/ruby/1.8/specifications - Ruby on Rails Permission denied - /root/.bundle/ruby/1.8/specifications Ruby on Rails:使用“rails generate controller Welcome”时权限被拒绝 - Ruby on Rails: permission denied when using “rails generate controller welcome” Ruby on Rails:权限被拒绝-“ 0.0.0.0”端口80(Errno :: EACCES)的bind(2) - Ruby on Rails: Permission denied - bind(2) for “0.0.0.0” port 80 (Errno::EACCES) Ruby on Rails:Errno :: EACCES(权限被拒绝-oo_26502 - Ruby on Rails : Errno::EACCES (Permission denied - oo_26502 PG::InsufficientPrivilege: 错误:创建数据库 Ruby on Rails 应用程序的权限被拒绝 - PG::InsufficientPrivilege: ERROR: permission denied to create database Ruby on rails application Errno :: EACCES:在Rails上创建新应用程序ruby的权限被拒绝 - Errno::EACCES: Permission denied in create new app ruby on rails 权限被拒绝 - bind(2) Errno::EACCES(Ruby on Rails,PostgreSQL 上的 Webpack) - Permission denied - bind(2) Errno::EACCES (Ruby on Rails, Webpack on PostgreSQL)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM