1.检查是否已有SSH文件
打开电脑终端,输入cd ~/.ssh检查是否存在SSH文件,一般第一次都会出现No such file or directory
2.创建密钥
输入命令行:ssh-keygen -t rsa -C “github创立时你的邮箱”,然后一直回车,遇到密码时回车就默认空
出现类似

3.找到文件复制密钥
找到类似上图Your public key has been saved in /Users/yf66/.ssh/id_rsa.pub中后面的路径,打开Finder前往该路径找到文件,打开文件复制所有内容即可.
网友评论