Created
June 17, 2013 19:17
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
([ -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