Skip to content

Instantly share code, notes, and snippets.

@jmvrbanac
Created July 29, 2014 15:20
Show Gist options
  • Save jmvrbanac/05400805609ea5eaefc5 to your computer and use it in GitHub Desktop.
Save jmvrbanac/05400805609ea5eaefc5 to your computer and use it in GitHub Desktop.
Copy ssh pub key to a list of servers
#!/bin/bash
pub_key=~/.ssh/id_rsa.pub
while read server
do
echo "Copying to $server"
ssh-copy-id -i $pub_key root@$server
done <servers.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment