Skip to content

Instantly share code, notes, and snippets.

@patmigliaccio
Created August 1, 2020 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patmigliaccio/316416b2143e8d2e89fee917d01d79b5 to your computer and use it in GitHub Desktop.
Save patmigliaccio/316416b2143e8d2e89fee917d01d79b5 to your computer and use it in GitHub Desktop.
A list of steps to generate new SSH keys to a new Linux VM / machine

Linux SSH Keys

A list of steps to generate new SSH keys to a new Linux VM / machine.

Generate a New Key

$ ssh-keygen -t rsa -b 2048

Enter file in which to save the key (/home/<user>/.ssh/id_rsa): ~/.ssh/**azure_key**

*No passphrase.*

*No passphrase.*

Rename Private Key

$ mv ~/.ssh/azure_key ~/.ssh/azure_key.pem

Add New Public Key to Authorized Keys on Server.

$ cat ~/.ssh/**azure_key**.pub >> ~/.ssh/authorized_keys

Set Secure Permissions on Private Key

$ chmod 400 ~/.ssh/**azure_key**.pem

SSH into Server

$ ssh -i **azure_key**.pem <user>@<dns name | ip address>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment