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.

  • How do I give Jenkins more heap space when it's running as a daemon on Ubuntu?
  • using git to update itself
  • git list all available commands
  • How to install and support node.js app from git on Ubuntu server
  • git rebase could not execute editor
  • git daemon slow first request on ubuntu 14.04
  • Git status slow on VMWare guest but not host
  • svnserve and SASL problem
  • 2 Solutions collect form web for “How to run git pull and bypass SSH passphrase prompt in user startup script?”

    Try 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

    Git Baby is a git and github fan, let's start git clone.