如果这里运行报错ssh: connect to host qq.com port 22: Connection timed out![在这里插入图片描述](https://img-blog.csdnimg.cn/20190725102300753.png)
删除多余的空格即可
$ ssh-keygen t rsa C "xxxx@xx.com"
报错: bash: $‘ssh\302\255keygen \302\255t rsa \302\255C xxxx@xx.com’: command not found![在这里插入图片描述](https://img-blog.csdnimg.cn/20190725101916433.png)
新生成的SSH密钥还没有生效,需要手动使其生效,指令为:
ssh -add ~/.ssh/youraccount_rsa
再次运行
成功公匙的命令输入全部直接下一步就行
$ ssh-keygen -t rsa -C "xxxx@xx.com"
获取公匙
$ cat ~/.ssh/id_rsa.pub
此时获取成功!