Last active
February 26, 2022 13:51
-
-
Save JonLevin25/668b0349c067c30206b792131fd14de4 to your computer and use it in GitHub Desktop.
Add all private ssh keys on init
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 | |
# Find and add _private_ keys | |
# note- may need adjustments for password-protected keys | |
eval `ssh-agent -s` | |
for f in $HOME/.ssh/*; do | |
fType=`file -b $f` | |
# echo "$f type: $fType" | |
if echo $fType | grep -i "private key"; then | |
ssh-add $f | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment