Skip to content

Instantly share code, notes, and snippets.

@pete911
Last active August 29, 2015 13:57
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 pete911/9504088 to your computer and use it in GitHub Desktop.
Save pete911/9504088 to your computer and use it in GitHub Desktop.
ssh key based authentication
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa -b 4096 -f ~/.ssh/<key_name>
ssh-copy-id -i ~/.ssh/<key_name>.pub <username>@<host>
# add following entry to ~/.ssh/config file
Host <host|alias>
HostName <host|ip>
User <username>
IdentityFile ~/.ssh/<keyname>
ssh <host|alias>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment