Skip to content

Instantly share code, notes, and snippets.

@raikel
Last active April 11, 2021 21:48
Show Gist options
  • Select an option

  • Save raikel/e486ba6ede3085fb7287831e89005365 to your computer and use it in GitHub Desktop.

Select an option

Save raikel/e486ba6ede3085fb7287831e89005365 to your computer and use it in GitHub Desktop.
SSH

Generate a new SSH key

ssh-keygen -t rsa -b 4096 -C "<mail_address>"

Add the key to the SSH agent:

ssh-agent bash # starts the SSH agent in backgroud
ssh-add ~/.ssh/id_rsa # adds the key

Add your key to a remote host

ssh-copy-id <user>@<host> # if password access is allowed
ssh-copy-id -f "-o <keyair>.pem" <user>@<host> # if no password access is allowed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment