Skip to content

Instantly share code, notes, and snippets.

@jpsirois
Created June 17, 2013 19:17
Show Gist options
  • Save jpsirois/5799490 to your computer and use it in GitHub Desktop.
Save jpsirois/5799490 to your computer and use it in GitHub Desktop.
Copy a public key to authorized_keys of a server via SSH for passphrase less connection
([ -f ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa ) && (ssh [email protected] "([ -d ~/.ssh ]||mkdir -m 700 ~/.ssh) && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" < ~/.ssh/id_rsa.pub)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment