MacOS生成SSH Key

1. 检查 SSH key 是否存在:

ls -a ~/.ssh

不存在:No such file or directory

2. 生成SSH Key

ssh-keygen -t rsa -C "[email protected]"

一直回车,连续 enter 3 次,就会生成 key,再 ls -a ~/.ssh检查,生成了两个文件 id_rsa和id_rsa.pub,id_rsa为私钥,id_rsa.pub为公钥,打开id_rsa.pub:

cd ~/.ssh

cat id_rsa.pub 

复制 id_rsa.pub 中的所有内容即可,粘贴到代码库网站就可以clone啦~

猜你喜欢

转载自blog.csdn.net/daydayup858/article/details/131092192
今日推荐