Created
September 5, 2014 05:34
-
-
Save Instagraeme/587ef043e719e1e9a59a to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
KEY="$HOME/.ssh/id_rsa.pub" | |
SERVERS="[email protected] [email protected] [email protected] webserver mediacenter" | |
if [ ! -f $KEY ];then | |
echo "private key not found at $KEY" | |
echo "* please create it with \"ssh-keygen -t rsa -b 2048\" *" | |
exit 1 | |
fi | |
for SERVER in $SERVERS | |
do | |
echo "Putting your key on $SERVER... " | |
ssh -q $SERVER "umask 0077; mkdir -p ~/.ssh ; echo "`cat $KEY`" > ~/.ssh/authorized_keys" | |
echo "done!" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment