Created
March 20, 2017 13:32
-
-
Save jpbochi/f31f6378724a903d3b5c695bd1eac7ed 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
#!/usr/bin/env sh | |
set -eu | |
eval $(ssh-agent -s) | |
KEYS=$(ls -p /var/ssh-keys/ | grep -v -e '/' -e config -e known_hosts -e '.pub$' -e authorized_keys) | |
echo "$KEYS" | xargs -I % ssh-add /var/ssh-keys/% | |
mkdir -p /root/.ssh | |
ssh-keyscan github.com >> /root/.ssh/known_hosts | |
echo 'host github.com' > /root/.ssh/config | |
echo ' HostName github.com' >> /root/.ssh/config | |
echo ' User git' >> /root/.ssh/config | |
echo "$KEYS" | sed 's/^/ IdentityFile \/var\/ssh-keys\//' >> /root/.ssh/config | |
$@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment