Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.