10

I was reading the question Tell git which private key to use, and the answer doesn't apply for a case were the user doesn't have any home directory.

We're setting up a Jenkins server right now, and the user who run Jenkins doesn't have any home folder. But that particular user must access a GIT repository.

How can the user running GIT use a key authentication?

FMaz008
  • 213
  • 2
  • 10

1 Answers1

15

The environment variable GIT_SSH tells git what ssh exectutable to use. So you could create a script something like:

#!/bin/bash
/usr/bin/ssh -i /path/to/identity.file "$@"

Then chmod it executable, and set GIT_SSH=/path/to/sshscript

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
Paul
  • 59,223
  • 18
  • 147
  • 168