-
-
Save rizo/7870188 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
ssh $1@$2 mkdir -p .ssh | |
cat /Users/luiscorreia/.ssh/id_rsa.pub | ssh $1@$2 'cat >> .ssh/authorized_keys' | |
printf "Host %s\n" "$3" >> /Users/luiscorreia/.ssh/config | |
printf "\tHostName %s\n" "$2" >> /Users/luiscorreia/.ssh/config | |
printf "\tUser %s\n" "$1" >> /Users/luiscorreia/.ssh/config | |
printf "\n" >> /Users/luiscorreia/.ssh/config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
ssh_add user host alias