Created
August 17, 2017 15:11
-
-
Save ammar/1a9111f5cf925a7fa63d295a8e8561bf 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/bash | |
key=`cat ~/.ssh/id_rsa.pub` | |
for host in $*; do | |
ssh $host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod -R 600 ~/.ssh/* && echo '$key' >> ~/.ssh/authorized_keys" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment