title: How do I pull from git on boot using Ubuntu (systemd), Github and SSH keys
body: <p>I have set it up so I auth with Github using ssh keys. I have tried everything out and it appears to be working. So now I want my app to run every time the computer boots so I create the following systemd config...</p>
  
  <pre><code>[Unit]
  Description=Job that runs your user script
  
  [Service]
  WorkingDirectory=/.../web/site
  ExecStart=npm start
  Type=oneshot
  RemainAfterExit=yes
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>Again everything seems to work. Now I want to pull every time I boot before I start so I change to...</p>
  
  <pre><code>[Unit]
  Description=Job that runs your user script
  
  [Service]
  WorkingDirectory=/.../web/site
  ExecStart=git pull
  ExecStart=npm start
  Type=oneshot
  RemainAfterExit=yes
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>But now it fails with...</p>
  
  <pre><code>Mar 08 05:45:21 debdev systemd[1]: Starting Job that runs your user script...
  Mar 08 05:45:21 debdev git[731]: Host key verification failed.
  Mar 08 05:45:21 debdev git[731]: fatal: Could not read from remote repository.
  Mar 08 05:45:21 debdev git[731]: Please make sure you have the correct access rights
  Mar 08 05:45:21 debdev git[731]: and the repository exists.
  Mar 08 05:45:21 debdev systemd[1]: node-site.service: Main process exited, code=exited, status=1/FAILURE
  Mar 08 05:45:21 debdev systemd[1]: node-site.service: Failed with result 'exit-code'.
  Mar 08 05:45:21 debdev systemd[1]: Failed to start Job that runs your user script.
  </code></pre>
  
  <p>What am I missing? Is it because my SSH key is under my user? Can I make a "root" ssh key?</p>