Created
January 24, 2019 20:03
-
-
Save tonejito/23d0f6be8a87252dd6204b609adc0eab to your computer and use it in GitHub Desktop.
Copy ssh public key for mass deployments
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
{print " export SSHPASS=\""$2"\"; sshpass -e ssh-copy-id -o StrictHostKeyChecking=no -i "$3" root@"$1""} |
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 -v | |
# Beware of -o StrictHostKeyChecking=no in awk file | |
awk -f copy-id.awk < hosts | bash -vx |
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
192.0.2.1 password ~/.ssh/id_rsa.pub | |
example.com password ~/.ssh/id_rsa.pub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment