Skip to content

Instantly share code, notes, and snippets.

@thejmazz
Created July 2, 2015 14:27
Show Gist options
  • Save thejmazz/5c2a4332f9821a9167d5 to your computer and use it in GitHub Desktop.
Save thejmazz/5c2a4332f9821a9167d5 to your computer and use it in GitHub Desktop.
Short script for generating ssh config file.
#!/bin/bash
sshdir="$HOME/.ssh"
# All keys should end in _rsa with their respective lock ending in _rsa.pub
keys=`ls $sshdir | grep _rsa$`
# Clean old config
rm $sshdir/config
# Build new config
for key in $keys
do
echo IdentityFile $sshdir/$key >> $sshdir/config
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment