Created
May 25, 2017 18:26
-
-
Save the-paulus/a361434b7f240f5b9f73867593168145 to your computer and use it in GitHub Desktop.
Creates a listing of entries for ssh's config file used for public/private key authentication.
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
while IFS='' read -r line || [[ -n "$line" ]] | |
do | |
user=$(echo $line | cut -d: -f 1) | |
domain=$(echo $line | cut -d' ' -f 2) | |
printf "\n\nHost $domain\n\tHostName $domain\n\tPort 22222\n\tUser $user\n\tIdentityFile ~/.ssh/id_rsa" | |
done < /etc/domainusers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment