Created
March 5, 2016 18:03
-
-
Save jamesrr39/c39ac8a9b5d4e7b05bec to your computer and use it in GitHub Desktop.
Transferring an SSH public key
This file contains 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
# transfer your public key to another computer | |
# variables that need changing marked with <> | |
public_key_path="<./ssh/machine-2/id_rsa.pub>" | |
remote_username="<james>" | |
remote_hostname="<192.168.x.x>" | |
key=$(cat $public_key_path) && \ | |
ssh $remote_username@$remote_hostname "echo $key >> ~/.ssh/authorized_keys" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment