[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

相关推荐
maosheng11463 小时前
RHCSA的第一次作业
linux·运维·服务器
NocoBase3 小时前
【2.0 教程】第 1 章:认识 NocoBase ,5 分钟跑起来
数据库·人工智能·开源·github·无代码
旺仔.2914 小时前
Linux 信号详解
linux·运维·网络
Hoshino.415 小时前
基于Linux中的数据库操作——下载与安装(1)
linux·运维·数据库
恒创科技HK5 小时前
通用型云服务器与计算型云服务器:您真正需要哪些配置?
运维·服务器
吴佳浩 Alben6 小时前
GPU 生产环境实践:硬件拓扑、显存管理与完整运维体系
运维·人工智能·pytorch·语言模型·transformer·vllm
播播资源6 小时前
CentOS系统 + 宝塔面板 部署 OpenClaw源码开发版完整教程
linux·运维·centos
学不完的7 小时前
Docker数据卷管理及优化
运维·docker·容器·eureka
lay_liu7 小时前
Linux安装redis
linux·运维·redis
量子位8 小时前
字节版龙虾架构火爆GitHub!开源获35k+ Star,内置Skill全家桶,原生适配飞书
github·ai编程