Last active
February 3, 2026 20:22
-
-
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/1ced4c5c5b43298acb607cec8a56465a695dade
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 License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) | |
| ## 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