使用git+ssh访问github,避免下载资源失败

一、创建github账户之后,记住注册邮箱和账户名

我的邮箱:yuanyan23@mails.ucas.ac.cn

账户名:thekingofjumpshoot

下边的相关位置需要用自己的邮箱和用户名替代

二、输入本地生成秘钥和公钥命令,并且生成公私钥对

复制代码
ssh-keygen -t rsa -C  "yuanyan23@mails.ucas.ac.cn"

输入命令后连摁三次enter即可生成秘钥

找到如图中的公钥位置,将其复制粘贴的github上的对应位置

如图是公钥的样子,复制出来待会使用

三、公钥粘贴的位置

四、测试是否连通

复制代码
sh -T git@github.com

若出现The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established.
ECDSA key fingerprint is  SHA256:XXX.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
     输入 yes

再输入一遍 ssh -T git@github.com
提示 Hi user.name! You've successfully authenticated, but GitHub does not provide shell access.

效果如图,即连接成功

五、配置过之后,下一次只需要输入如下代码即可连接

复制代码
git config --global user.email  "yuanyan23@mails.ucas.ac.cn"
git config --global user.name  "thekingofjumpshoot"
相关推荐
fpcc4 小时前
工具使用—git add命令分析说明
git·工具
问天_观心7 小时前
零基础在windows环境下的WSL使用llamafactory(二)
人工智能·神经网络·语言模型·github·模型蒸馏
逛逛GitHub9 小时前
AI 时代 Markdown 又火了,7 款 GitHub 高赞开源编辑器。
github
独隅9 小时前
VS Code Git 工作树多分支并行开发实战指南
大数据·git·elasticsearch
u1301309 小时前
GitHub 热榜项目:日榜(2026-08-18)
github
峰向AI10 小时前
5万多人点赞的下载工具,凭什么让我放下了用了三年的老软件
github
软泡芙11 小时前
【IOS】Codable
ios·ssh·cocoa
小玮看世界13 小时前
AtomGit 429 报错引发的思考:从“未授权限流”看开源平台的“浏览权”博弈
开源·github
枝枝在Coding13 小时前
跳板机明明能连上,为什么内网服务器还是进不去?
ssh