Skip to content

Instantly share code, notes, and snippets.

@huksley
Last active December 27, 2015 02:49
Show Gist options
  • Save huksley/7255337 to your computer and use it in GitHub Desktop.
Save huksley/7255337 to your computer and use it in GitHub Desktop.
Copy all your public keys to remote host
#!/bin/sh
# Synopsis: Copy all your public keys to remote host, enabling public key authentication on remote host
HOST=$1
if [ "$HOST" = "" ]; then
echo Usage: $0 \<hostname\>
exit 1
fi
for N in `ls $HOME/.ssh/id_*.pub`; do
ssh-copy-id -i $N $HOST
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment