[yotroy.cool]记一次将SSH公钥添加到GitHub
个人博客https://www.yotroy.cool/,欢迎关注我哦~
============================================================
前言
ssh key又过期了,每次重新添加都要回看documentation,自己写一个方便记的。
步骤
以Ubuntu为例
$ ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
$ #输入名字
$Enter passphrase (empty for no passphrase): 输入密码
$Enter same passphrase again: 再次输入密码
如果在输入名字处直接回车会输出如下
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256: ....code..... root@system
直接cat指令
cat ~/.ssh/id_rsa.pub
输出直接复制到GitHub的Add new SSH Key中即可。
测试
$ ssh -T git@github.com
问题
可能存在国内无法连接问题,可尝试更换dns
原文地址:https://blog.csdn.net/Troy_Zhang1112/article/details/137614273
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!