Linux 配置 GitHub 账号

Step 1 生成 SSH 私钥/公钥 打开终端,使用 ssh-keygen 工具生成 SSH 私钥(GitHub 推荐方法): [kwang@Slave02 ~]$ ssh-keygen -t ecdsa -b 521 -C "prc.wkai@gmail.com" Generating public/private ecdsa key pair. Enter file in which to save the key (/home/kwang/.ssh/id_ecdsa): /home/kwang/.ssh/id_ecdsa Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/kwang/.ssh/id_ecdsa. Your public key has been saved in /home/kwang/.ssh/id_ecdsa.pub. The key fingerprint is: 14:21:b7:06:4c:e4:cd:39:c8:1f:bd:09:64:42:80:3b prc.wkai@gmail.com The key's randomart image is: +--[ECDSA 521]---+ | ..*B *. | | . o.@ = | | . + @ . | | E + + o | | . S o | | | | | | | | | +-----------------+ Step 2 配置 SSH 公钥 登录 GitHub 主页,在个人设置中选择“SSH and GPG keys”,单击“New SSH key”,将上一步中生成的公钥(id_ecdsa.pub)复制进来(下图)。 GitHub 配置 SSH 公钥 Step 3 克隆 Repo 在服务器终端运行 git 配置账号和对应的 repo: [kwang@Slave02 ~]$ git clone...

2022年8月23日 · 1 分钟 · 403 字 · Kai Wang