Skip to content

Instantly share code, notes, and snippets.

@dungdt88
Last active March 7, 2016 06:15
Show Gist options
  • Save dungdt88/72fbaf85ef3cf2926670 to your computer and use it in GitHub Desktop.
Save dungdt88/72fbaf85ef3cf2926670 to your computer and use it in GitHub Desktop.
SSH with Public Key
# On Client
## Generate Key
ssh-keygen -t rsa {-b 4096}
## Copy identity to remote-host (requires remoteuser's password)
ssh-copy-id -i <path/to/public/key> <remoteuser>@<remotehost>
## or just copy the content of file ~/.ssh/id_rsa.pub on Client to the end of file ~/.ssh/authorized_keys on Server
## SSH
ssh -i <path/to/private/key> <remoteuser>@<remotehost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment