?生成SSH key
- 打开Git?Bash
- 粘贴如下命令,并将email地址更换为注册github帐号的邮箱
$ ssh-keygen -t rsa -b 4096 -C "***@163.com"
? ? ?3. 连续敲击3次回车,即可在C:\Users\Administrator\.ssh目录中生成
配置SSH key
- 使用记事本打开id_rsa.pub文件,复制里面的文本内容
- 在浏览器中登陆Github,点击头像——Settings——SSH and GPG Keys——New SSH key
- 将id_rsa.pub文件中的内容,粘贴到Key对应的文本框中
- 在Title文本框中任意填写一个名称,来标识这个Key从何而来
检测github 的SSH key是否配置成功
打开Git Bash,输入如下命令并回车执行
ssh -T git@github.com
$ ssh -T git@github.com
回车后执行以下代码 然后再输入yes来回车确定
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?
显示如下代码则配置成功
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
Hi bianmeng-anna! You've successfully authenticated, but GitHub does not provide shell access.
|