首先查看是否已经生成ssh公钥

cat ~/.ssh/id_rsa.pub
如果显示 cat: /Users/********/.ssh/id_rsa.pub: No such file or directory

说明没有,就需要创建公钥

 

用ssh-keygen创建公钥

ssh-keygen
创建好后就可以用cat ~/.ssh/id_rsa.pub查看了