Generate an SSH Key
Appearance
This page contains information about generating a public SSH Key. If you are generating a key for production access, please see SRE/Production access#Generating your SSH key.
Generate an SSH key
### Generate SSH key
ssh-keygen -t ed25519 -C "your_email@youremail.com" # Replace email's value, save on default filename, type your passphrase
cat ~/.ssh/id_ed25519.pub # Public key, to copy into your other tools
# ~/.ssh/id_ed25519 # Private key, keep this private!
A fingerprint and randomart image for the key will also be generated.
Add or Change a passphrase
Add or change the SSH passphrase using this command:
- Enter the following into your terminal
$ ssh-keygen -p, and press Enter. - When prompted
Enter file in which the key is (/Users/you/.ssh/id_rsa):, type the location of your key and press Enter. - Enter your old passphrase, and press Enter.
- Enter the same passphrase again, and press Enter.
our identification has been saved with the new passphrase.
Notes
- Make sure to choose a passphrase. Do not leave it empty.
ssh-agentcan be used to store your passphrase securely, so you do not have to re-enter it.- Mac OS X Leopard or later and Linux users SSH can save their passphrase in the system's keychain.