- 打开终端执行:(本文以mac为例)
邮箱为提交代码时的邮箱。
ssh-keygen -t rsa -C 182xxxx8381@163.com
输完按回车。接着会提示:Enter file in which to save the key (/Users/a11/.ssh/id_rsa)继续按回车,接着输入开机密码显示下图信息就创建成功了。
- 进入上面提示的.ssh文件夹 终端分别输入。
cd ~/.ssh
vim id_rsa.pub
邮箱为提交代码时的邮箱。
ssh-keygen -t rsa -C 182xxxx8381@163.com
输完按回车。接着会提示:Enter file in which to save the key (/Users/a11/.ssh/id_rsa)继续按回车,接着输入开机密码显示下图信息就创建成功了。
cd ~/.ssh
vim id_rsa.pub