Fork me on GitHub

生成SSH公钥和私钥

生成公钥

ssh-keygen -t rsa -C "your_email@example.com"

# ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

# 推荐使用默认地址
# Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]

# 此处点击Enter键即可,也可以填写密码,填写密码后每次使用SSH方式推送代码时都会要求输入密码。
# Enter passphrase (empty for no passphrase):

查看公钥

cat ~/.ssh/id_rsa.pub

# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....