随便找个文件夹 右键打开Bash

 ssh-keygen -t ed25519 -C "zhaozhengyan@live.com"

提示输入文件名, 输入 id

Enter file in which to save the key (/c/Users/zhaozhengyan/.ssh/id_ed25519): id

提示输入密码:

Enter passphrase (empty for no passphrase):

再次输入密码:

Enter same passphrase again:

提示创建成功

Your identification has been saved in id
Your public key has been saved in id.pub

输入 clip 命令复制 密钥的key, 或者直接打开pub文件复制里面的内容

clip < id.pub

将key复制到Github SSH keys里面,key的格式大致如下

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5adeDbs/VOcg41U2ySIH3DODrU5llBcLlfnFqb0ZrKasvzr7y zhaozhengyan@live.com

添加成功后,打开刚刚的 bash 命令窗口

eval "$(ssh-agent -s)"

测试是否能连接到Github

 ssh -T git@github.com

提示 hi, 大功告成!

Hi zhaozhengyan! You've successfully authenticated, but GitHub does not provide shell access.

相关文章:

  • 2021-06-11
  • 2021-09-28
  • 2021-09-29
  • 2021-06-25
  • 2021-09-05
猜你喜欢
  • 2022-01-09
  • 2021-06-14
  • 2021-09-21
  • 2021-08-30
  • 2021-12-16
相关资源
相似解决方案