[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

相关推荐
乱蜂朝王1 小时前
Ubuntu 20.04安装CUDA 11.8
linux·运维·ubuntu
Lw老王要学习3 小时前
Windows基础篇第一章_01VMware虚拟机安装window10
运维·windows·虚拟机
yuanmenghao3 小时前
车载Linux 系统问题定位方法论与实战系列 - 车载 Linux 平台问题定位规范
linux·运维·服务器·网络·c++
qq_589568105 小时前
centos6.8镜像源yum install不成功,无法通过镜像源下载的解决方式
linux·运维·centos
weixin_516023075 小时前
linux下fcitx5拼音的安装
linux·运维·服务器
hunter14506 小时前
Linux 进程与计划任务
linux·运维·服务器
楼田莉子6 小时前
Linux学习之磁盘与Ext系列文件
linux·运维·服务器·c语言·学习
陌上花开缓缓归以6 小时前
linux 怎么模拟系统panic重启
linux·运维·服务器
月白风清江有声7 小时前
vscode使用git
linux·运维·服务器
haluhalu.9 小时前
深入理解Linux线程机制:线程概念,内存管理
java·linux·运维