门户网站样式,willfast优化工具下载,搜索引擎营销sem,网站后台管理需求生成和使用 SSH 密钥对是一种安全的身份验证方式#xff0c;用于在你的本地系统和 GitHub 之间进行身份验证。以下是在 GitHub 上生成和使用 SSH 密钥对的基本步骤#xff1a;
1. 生成 SSH 密钥对
在命令行中执行以下命令来生成 SSH 密钥对#xff1a;
ssh-keygen -C 用于在你的本地系统和 GitHub 之间进行身份验证。以下是在 GitHub 上生成和使用 SSH 密钥对的基本步骤
1. 生成 SSH 密钥对
在命令行中执行以下命令来生成 SSH 密钥对
ssh-keygen -C your_emailexample.com-C your_emailexample.com: 添加注释一般填写你的 GitHub 注册邮箱。
在执行命令时你可以选择为密钥对选择一个自定义的文件名和路径或者直接按 Enter 使用默认路径一般是 ~/.ssh/id_rsa。
2. 将 SSH 密钥添加到 GitHub
使用以下命令将公钥添加到 GitHub。你需要将 ~/.ssh/id_rsa.pub 文件中的内容复制并粘贴到 GitHub 的 SSH 设置中。
cat ~/.ssh/id_rsa.pub3. 测试 SSH 连接
使用以下命令测试 SSH 连接是否正常
ssh -T gitgithub.com(base) pddpdd-Dell-G15-5511:~$ ssh -T gitgithub.com
ssh: connect to host github.com port 22: Connection timed out
(base) pddpdd-Dell-G15-5511:/etc/apt$ vim ~/.ssh/config
(base) pddpdd-Dell-G15-5511:/etc/apt$ cat ~/.ssh/config
Host github.comHostname ssh.github.comPort 443(base) pddpdd-Dell-G15-5511:~$ ssh -T gitgithub.com
Hi *****! Youve successfully authenticated, but GitHub does not provide shell access.git—如何解决The authenticity of host ‘github.com (192.30.255.112)’ can’t be established.
Git报错 Failed to connect to github.com port 443
# https://blog.csdn.net/ResumeProject/article/details/128594105
git config --global --replace-all https.proxy 192.168.31.203:7890
git config --global --replace-all http.proxy 192.168.31.203:7890