【ASK】git使用中出现Permission denied (publickey).
好久没有用git了,今天突然执行了一下
$git submodule update --init --recursive
===============================
结果出现如下提示
Cloning into 'Submodules/********'...
Permission denied (publickey).
===============================
由于确实好长时间没有摸过git了,一点印象都没有了。没办法,只能google了,还好一搜就得到一片经典官方帮助:
https://help.github.com/articles/generating-ssh-keys/
=================================
Generating SSH keys
SSH keys are a way to identify trusted computers, without involving passwords. The steps below will walk you through generating an SSH key and adding the public key to your GitHub account.
We recommend that you regularly review your SSH keys list and revoke any that haven't been used in a while.
Tip: GitHub has a Mac client! You can use it without ever touching the command line.
Step 1: Check for SSH keys
First, we need to check for existing SSH keys on your computer. Open Terminal and enter:
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
Check the directory listing to see if you already have a public SSH key. By default, the filenames of the public keys are one of the following:
- id_dsa.pub
- id_ecdsa.pub
- id_ed25519.pub
- id_rsa.pub
Tip: If you receive an error that the ~/.ssh doesn't exist,, don't worry! We'll create it in Step 2.
Step 2: Generate a new SSH key
With Terminal still open, copy and paste the text below. Make sure you substitute in your GitHub email address.
ssh-keygen -t rsa -C "your_email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.We strongly suggest keeping the default settings as they are, so when you're prompted to "Enter a file in which to save the key", just press Enter to continue.
# Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
You'll be asked to enter a passphrase.
# Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]Tip: We strongly recommend a very good, secure passphrase. For more information, see "Working with SSH key passphrases".
After you enter a passphrase, you'll be given the fingerprint, or id, of your SSH key. It will look something like this:
# Your identification has been saved in /Users/you/.ssh/id_rsa.
# Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
Step 3: Add your key to the ssh-agent
To configure the ssh-agent program to use the SSH key you've generated:
Ensure ssh-agent is enabled:
# start the ssh-agent in the background
eval "$(ssh-agent -s)"
# Agent pid 59566Add your generated SSH key to the ssh-agent:
ssh-add ~/.ssh/id_rsa
Step 4: Add your SSH key to your account
To configure your GitHub account to use your SSH key:
Copy the SSH key to your clipboard. Keep in mind that your key may also be named id_dsa.pub,id_ecdsa.pub or id_ed25519.pub, in which case you must change the filename as follows:
pbcopy < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard
Warning: It's important to copy the key exactly without adding newlines or whitespace.
Add the copied key to GitHub:
In the top right corner of any page, click .
In the user settings sidebar, click SSH keys.
Click Add SSH key.- In the Title field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
Paste your key into the "Key" field.
Click Add key.- Confirm the action by entering your GitHub password.
Step 5: Test the connection
To make sure everything is working, you'll now try to SSH into . When you do this, you will be asked to authenticate this action using your password, which is the SSH key passphrase you created earlier.
Open Terminal and enter:
ssh -T git@github.com
# Attempts to ssh to GitHubYou may see this warning:
# The authenticity of host 'github.com (207.97.227.239)' can't be established.
# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
# Are you sure you want to continue connecting (yes/no)?Verify the fingerprint in the message you see matches the following message, then type
yes:# Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.If the username in the message is yours, you've successfully set up your SSH key!
If you receive a message about "access denied," you can read these instructions for diagnosing the issue.
If you're switching from HTTPS to SSH, you'll now need to update your remote repository URLs. For more information, see Changing a remote's URL.
================================
讲的十分详细,再次感谢一下,一步一步安装文档所说进行,竟然意外的发现以前就在自己的github上已经做过类似的操作了。难道真是上了岁数,忘得一干二净......
【ASK】git使用中出现Permission denied (publickey).的更多相关文章
- git@github.com: Permission denied (publickey).////remote: Permission to xxx/test.git denied to xxx.等权限问题
Error msg git@github.com: Permission denied (publickey) 或者: remote: Permission to xxx/test.git denie ...
- github:当你想要使用VSCODE开心提交代码时,出现Git:git@github.com:Permission denied(publickey)解决方案
当你想要使用VSCODE开心提交代码时,出现Git:git@github.com:Permission denied(publickey)弹框 图片: 原因:电脑公钥(publickey)未添加至gi ...
- 使用Git出现以下错误"Git@github.com: Permission denied (publickey). Could not read from remote repository."解决方案
转载于:https://blog.csdn.net/dotphoenix/article/details/100130424 git@github.com: Permission denied (pu ...
- git实战中遇到git@github.com: Permission denied (publickey).的问题
一.问题我们在使用git的时候会建立一个私钥和一个公钥来完成彼此的通讯,因此如何使用给一个指令建立一个秘钥至关重要.但是我在实践的过程中出现了git@github.com: Permission de ...
- ubuntu下git clone 出现Permission denied (publickey).
今天在ubuntu上使用git 克隆 github上面的库,一直权限拒绝Permission denied (publickey). 公钥绑了好几次,都不行: 最后怀疑是git配置公钥地址有问题:打开 ...
- centos: git clone提示Permission denied publickey 问题
问题: Initialized empty Git repository in /data1/mouxuan/fastsocket-private/.git/ Permission denied (p ...
- 【git基础】Permission denied (publickey). fatal: Could not read from remote repository
运行以下git命令的时候出现错误 git push -u origin master error The authenticity of host 'github.com (13.250.177.22 ...
- IDEA中使用git报错Permission denied (publickey)
最近在使用idea开发时,使用git拉取远程仓库的代码时,报错Permission denied (publickey),原因是因为ssh的密钥失效,必须得重新设置下ssh的密钥即可. 命令很简单,在 ...
- git 时 出现 Permission denied (publickey).
https://blog.csdn.net/awp0011/article/details/73368481 第一次使用github.com在本地 执行 git clone git@github.co ...
随机推荐
- 通过LR监控Linux服务器性能
1)设置监控服务器要监控 UNIX 资源,必须配置 rstatd 守护程序.注意,可能已经配置了 rstatd守护程序,因为当计算机收到一个 rstatd 请求时,该计算机上的 inetd 自动激活r ...
- Openerp开发进销存系统完毕总结
转自:http://blog.csdn.net/heartrude/article/details/9142463 安装Openoffice 在openoffice中安装openerp repor ...
- [Exception IOS 4] - could not build module 'foundation'
出现这个问题首先百度找到的是:http://www.cocoachina.com/bbs/read.php?tid=188086 然后在blog中能找到链接:http://stackoverflow. ...
- CAS 与 无锁队列
http://coolshell.cn/articles/8239.html http://www.tuicool.com/articles/VZ3IBv http://blog.csdn.net/r ...
- 单元测试JUnit 4 (一)——keeps the bar green to keeps the code clean
1. 导读 Junit是一个可编写重复测试的简单框架,是基于Xunit架构的单元测试框架的实例.Junit4最大的改进是大量使用注解(元数据),很多实际执行过程都在Junit的后台做完了,而且写tes ...
- 说说iDempiere = OSGi + ADempiere的OSGi
怀揣着为中小企业量身定做一整套开源软件解决方案的梦想开始了一个网站的搭建.http://osssme.org/ 我对iDempiere还完全摸不着头脑,正好在学习之际,应erp100的@纵横四海 邀请 ...
- 模拟循环单击事件实现layout中间panel全屏
jquery提供了toggle方法 toggle() 方法切换元素的可见状态. 如果被选元素可见,则隐藏这些元素,如果被选元素隐藏,则显示这些元素. 语法 $(selector).toggle(spe ...
- Asp.Net MVC4的学习概况
周一正式开始了毕业工作.然后学习调试了近4天,刚刚总算在同事的帮助下做出了一个基于Asp.Net MVC4的Hello World显示. 这是一篇最为基础的记录教程,记录内容可能有点混乱,旨在能在刚调 ...
- 冻结 锁定 固定 行 列 表头 抬头 html table jquery 全兼容常见浏览器
转:http://www.cnblogs.com/sorex/archive/2011/06/30/2093499.html <!DOCTYPE html PUBLIC "-//W3C ...
- c#.net调用pdf2swf.exe将pdf文件转换为swf,vs中运行正常,布署IIS服务器部署转换后文字部分为空白
这个是权限问题, 需要在应用程序池中高级设置,将标识改为LocalSystem