Skip to content

Instantly share code, notes, and snippets.

@instaBOT
Created January 11, 2017 16:39
Show Gist options
  • Save instaBOT/dc45155cb054e89b22e518b3f1fabab6 to your computer and use it in GitHub Desktop.
Save instaBOT/dc45155cb054e89b22e518b3f1fabab6 to your computer and use it in GitHub Desktop.
Create a SSH key pair (RSA) in Ubuntu 14.04.
#!/usr/bin/env bash
cd
set -eu
# Create passphrase-less RSA key pair for SSH.
# - 'rsa': protocol version 2
# - 4096: the number of bits in the key to create (for RSA keys, minimum: 768, default: 2048 bits)
# - "": passphrase
# - '~/.ssh/id_rsa': the new key file
ssh-keygen -t rsa -b 4096 -N "" -f ~/.ssh/id_rsa
printf "\npublic key of the generated RSA key pair:\n\n"
cat ~/.ssh/id_rsa.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment