1、检查系统是否已存在SSH密钥
cat ~/.ssh/id_rsa.pub
如果看到以ssh-rsa或开头的长字符串ssh-dsa,则可以跳过下一步的ssh-keygen步骤
2、生成新的SSH密钥
ssh-keygen -t rsa -C ‘xxx@xxx.com’ 然后一路回车(-C 参数是你的邮箱地址)
显示公钥
cat ~/.ssh/id_rsa.pub
复制公钥
Windows:
clip < ~/.ssh/id_rsa.pub
Mac:
pbcopy < ~/.ssh/id_rsa.pub
或者:
打开/.