Last active
April 2, 2023 10:10
-
-
Save dacr/d506fb69b86f6804028c233d3a981243 to your computer and use it in GitHub Desktop.
ssh agent automatic provisioning using a ssh private key initialized through an environment variable. / published by https://github.com/dacr/code-examples-manager #3a860b1c-a0c5-4a10-9e1e-95f5edb7a643/85f00b1fa1594984431a1f31859e645ebb3c2c8d
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
## summary : ssh agent automatic provisioning using a ssh private key initialized through an environment variable. | |
## keywords : bash, ssh, ssh-agent, ssh-keys | |
## publish : gist | |
## authors : David Crosson | |
## license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
## id : 3a860b1c-a0c5-4a10-9e1e-95f5edb7a643 | |
## created-on : 2019-07-02T19:44:51+02:00 | |
## managed-by : https://github.com/dacr/code-examples-manager | |
eval $(ssh-agent -s) | |
echo "$WRITE_SSH_PRIVATE_KEY" | ssh-add - | |
# For next lines, remember you should know what you're doing ;) | |
mkdir -m 700 $HOME/.ssh | |
ssh-keyscan -H www.somehosts.fr >> ~/.ssh/known_hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment