How to run git pull and bypass SSH passphrase prompt in user startup script?
This is on Ubuntu, I have a user startup shell script that runs every time the instance boots (EC2 via
--user-data-file argument). I want to have the instance do a git pull from a specific branch every time it boots. The problem is when I do a git pull, there is a SSH key passphrase prompt and I am not sure what the best way is to automatically enter the password in a shell script.
- git remote does not appear to be a git repository (dokku)
- Possible to http clone repo to Docker Container?
- Permission denied (publickey) when cloning in webroot directory but not in ~/.ssh
- How do I give Jenkins more heap space when it's running as a daemon on Ubuntu?
- Accessing linux mount location on windows through jenkins
- Issues with previous operation not finishing
2 Solutions collect form web for “How to run git pull and bypass SSH passphrase prompt in user startup script?”
Try Expect http://en.wikipedia.org/wiki/Expect
it will allow you to provide password to interactive ssh session
You should generate your public ssh key and ask the administrator of that branch to store the key in his authorized_keys file.
This is what you should do:
Generating Your SSH Public Key
This is what the administrator should do:
How to Use RSA Key for SSH Authentication