遇到问题:ssh: Could not resolve hostname github: Temporary failure in name resolution
解决方法:github添加ssh的key
步骤:
cd ~/.ssh
ls
>>id_rsa id_rsa.pub #有这两个文件说明已经添加过ssh key,但一般需要重新生成
ssh-keygen -t rsa -C "你的邮箱地址"
#创建ssh key
#-t 指定密钥类型,默认rsa ,可省略;
#-C 设置注释文字,比如邮箱;
#-f 指定密钥文件存储文件名。
Generating public/private rsa key pair.
Enter file in which to save the key (/home/overlord/.ssh/id_rsa): #Enter回车
/home/overlord/.ssh/id_rsa already exists.
Overwrite (y/n)? y #输入y
Enter passphrase (empty for no passphrase): #Enter回车
Enter same passphrase again: #Enter回车
Your identification has been saved in /home/XX/.ssh/id_rsa
Your public key has been saved in /home/XX/.ssh/id_rsa.pub
The key fingerprint is:
XXXXXX
The key's randomart image is:
+---[RSA XXXX]----+
| |
| XXXxx |
| |
| xXXXXXX |
|XXXXXXXXXXX |
|X X |
|XXXXXXXXX |
|XXXXXXXX |
| XXXXX |
+----[XXXX]-----+
##创建成功
接着复制刚刚生成的密钥,vi id_rsa.pub
,打开文件后全部copy
也可以用这个指令:cat ~/.ssh/id_rsa.pub
下面登录你刚刚输入的邮箱所创建的github账号,按照如下步骤操作:
至此添加成功!
再次测试ssh -T git@github.com
文章来源:https://www.toymoban.com/news/detail-721914.html
Hi XX! You've successfully authenticated, but GitHub does not provide shell access.
问题解决~文章来源地址https://www.toymoban.com/news/detail-721914.html
到了这里,关于【github添加ssh的key】ssh: Could not resolve hostname github: Temporary failure in name resolution的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!