#直接回车就好,免得记太多,生成的文件会打印在控制台
ssh-keygen -t rsa -b 4096 -C "xxxxx@xxxxx.com"
#执行上面后生成
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/xxx/.ssh/id_rsa):
# Enter passphrase (empty for no passphrase):
# Enter same passphrase again:
# Your identification has been saved in /home/xxx/.ssh/id_rsa //这个是私钥,别删
# Your public key has been saved in /home/xxx/.ssh/id_rsa.pub //公钥
再到github个人账号setting->SSH and GPG keys导入/home/xxx/.ssh/id_rsa.pub里面的key即可
后面使用ssh选项同步仓库即可