1.Windows下生成.ssh文件,若已经生成,则找到该文件;
打开git 命令行:ls -al ~/.ssh 来查看是否有ssh key存在;
检查/.ssh目录来查看是否存在公开的ssh key
一般而言,公开的ssh key的文件名为以下几种:
创建一个 SSH key :
在你检查过存在的ssh key后,你可以新建一个ssh key:
打开Git Bash
输入这一串:“ ” 中的内容为公司分配的个人邮箱/自己的邮箱
$ ssh-keygen -t rsa -C "your_email@example.com"
生成了之后去你本地c://用户名//.ssh文件夹下找有两个文件,把pub打开复制到github上;
生成的地址:C:\Users\hasee\.ssh
2.测试一下该SSH key
ssh -T git@github.com
注意:http://teamcode.xxxxx.net/#/dashboard/self 其中xxxxx为公司的标志
hasee@ZMC MINGW64 ~
$ ls -al ~/.ssh
ls: cannot access '/c/Users/hasee/.ssh': No such file or directory
hasee@ZMC MINGW64 ~
$ ssh-keygen -t rsa -C "zhangmiaocheng@xxxxx.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/hasee/.ssh/id_rsa):
Created directory '/c/Users/hasee/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/hasee/.ssh/id_rsa.
Your public key has been saved in /c/Users/hasee/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:5I/cwhM6Tps4xmgkAislERFhy1xqH0OsSWr5DrXYS9w zhangmiaocheng@fangdd.com
The key's randomart image is:
+---[RSA 2048]----+
|=*.o |
|=.=. |
|oB+o . |
|==o.o o |
|o+*.o S |
|=o.* E + = |
|oo+o. + * o |
| oo++ + o |
| . ...+ |
+----[SHA256]-----+