Skip to content

Instantly share code, notes, and snippets.

@richardkall
Last active December 12, 2016 12:48
Show Gist options
  • Save richardkall/4041970 to your computer and use it in GitHub Desktop.
Save richardkall/4041970 to your computer and use it in GitHub Desktop.

#Password-less SSH

Generate keys on local machine:

$ ssh-keygen

Create ~/.ssh directory on remote machine.

Copy local ~/.ssh/id_rsa.pub to remote ~/.ssh/authorized_keys:

Method A:

$ ssh-copy-id -i ~/.ssh/id_rsa.pub user@host

Method B:

$ cat ~/.ssh/id_rsa.pub | ssh user@host 'cat >> ~/.ssh/authorized_keys'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment