Skip to content

Instantly share code, notes, and snippets.

@ruanyf
Created February 4, 2016 09:04
Show Gist options
  • Save ruanyf/4d2bafcdb437b059b966 to your computer and use it in GitHub Desktop.
Save ruanyf/4d2bafcdb437b059b966 to your computer and use it in GitHub Desktop.
3 Ways of Generating SSH Keys: OpenSSH, OpenSSL and GPG
# OpenSSH
# 运行后,要求用户提供密钥文件名
# 然后在当前目录生成两个密钥文件:id_rsa(私钥)和id_rsa.pub(公钥)
$ ssh-keygen -t rsa -b 4096 -C "your.email@service.com"

# OpenSSL
# 生成私钥,然后生成公钥
$ openssl genrsa -out private_key.pem 4096
$ openssl rsa -pubout -in private_key.pem -out public_key.pem

# GPG
$ gpg --gen-key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment