= SSH KeyGen = '''`ssh-keygen(1)`''' is used to generate public-private keypairs. <> ---- == Installation == `ssh-keygen(1)` is bundled with `openssl`. ---- == Usage == To generate a new SSH key, try: {{{ ssh-keygen -t rsa -b 4096 -C "me@example.com" }}} Note that standards are always shifting. In the past, Github recommended a 2048 bits long key. Github now recommends the `ed25519` algorithm, instead of `rsa`. === Legacy Format === OpenSSH 7.8+ uses a new format of SSH keys, which begin with `-----BEGIN OPENSSH PRIVATE KEY-----`. Some software are not prepared to parse this key format. To generate a new key using the old format, add the `-m PEM` option. To convert an existing key to the old format, try: {{{ ssh-keygen -p -f ~/.ssh/id_rsa -m pem -P "" -N "" }}} === Commercial Services === [[https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account|Github]] and [[https://docs.gitlab.com/ee/ssh/#adding-an-ssh-key-to-your-gitlab-account|Gitlab]] both allow SSH key authentication. ---- == See also == [[https://man.archlinux.org/man/core/openssh/ssh-keygen.1.en|ssh-keygen(1)]] [[Encryption/OpenSSH|OpenSSH]] [[Encryption/SSH|SSH]] ---- CategoryRicottone