Last active
December 11, 2015 01:18
-
-
Save jcanfield/4522006 to your computer and use it in GitHub Desktop.
Revisions
-
jcanfield revised this gist
Jan 13, 2013 . 1 changed file with 9 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,17 +6,18 @@ # I typically create the script in my ~/.bin and symbolically it to my /usr/local/sbin. # $ touch ~/.bin/copykeys.sh # $ chmod +x ~/.bin/copykeys.sh # $ nano ~/.bin/copykeys.sh # $ sudo ln -s /home/yourusername/.bin/copykeys.sh /usr/local/sbin/copy-ssh-key #!/bin/bash echo "Copying local SSH Key to $1..." echo "Example Usage: copy-ssh-key [email protected]" cat ~/.ssh/id_rsa.pub | ssh $1 "cat - >> .ssh/authorized_keys" echo "Your Public SSH Key was copied to $1." exit # Second Method is use the Copy Keys script available via the Repositories (Debian/Ubuntu0 ssh-copy-id <username>@<host> -
jcanfield created this gist
Jan 13, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # Copy SSH Keys to Remote Server (for password-less access) # # More information copying SSH Keys to remote servers can be found at, https://help.ubuntu.com/community/SSH/OpenSSH/Keys. # Method One is to create a simple script. # I typically create the script in my ~/.bin and symbolically it to my /usr/local/sbin. # $ touch ~/.bin/copykeys.sh # $ chmod +x ~/.bin/copykeys.sh # $ nano ~/.bin/copykey.sh #!/bin/bash echo "Copying local SSH Key to $1..." echo "Example Usage: copykeys [email protected]" cat ~/.ssh/id_rsa.pub | ssh $1 "cat - >> .ssh/authorized_keys" echo "Your Public SSH Key was copied to $1." exit # Second Method is use the Copy Keys script available via the Repositories (Debian/Ubuntu0 ssh-copy-id <username>@<host>