五分钟 配置 Git 使用 SSH 访问(Configure git for SSH access in five minutes)

随便找个文件夹 右键打开Bash
ssh-keygen -t ed25519 -C “zhaozhengyan@live.com”

提示输入文件名, 输入
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.

随便找个文件夹 右键打开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.
————————

随便找个文件夹 右键打开Bash
ssh-keygen -t ed25519 -C “zhaozhengyan@live.com”

提示输入文件名, 输入
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.

Right click any folder to open bash

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

Prompt for file name, enter

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

Prompt for password:

Enter passphrase (empty for no passphrase):

Enter the password again:

Enter same passphrase again:

Prompt creation succeeded

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

Enter the clip command to copy the key of the key, or directly open the pub file to copy the contents

clip < id.pub

Copy the key to GitHub SSH keys. The format of the key is roughly as follows

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5adeDbs/VOcg41U2ySIH3DODrU5llBcLlfnFqb0ZrKasvzr7y zhaozhengyan@live.com

After adding successfully, open the bash command window just now

eval "$(ssh-agent -s)"

Test whether you can connect to GitHub

 ssh -T git@github.com

Hint Hi, it’s done!

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