# How do you script linux GIT client to pass kerberos credential to apache enabled GIT server?

3 messages from 2017-04-03 to 2017-04-04. Participants: ken edward, Randall S. Becker, Mantas Mikulėnas.
Thread: https://gitlist.dev/t/45597

## ken edward, 2017-04-03 16:04

Subject: How do you script linux GIT client to pass kerberos credential to apache enabled GIT server?
Message-ID: <CAAqgmoP2uyd5_k-JDOBpBV8ay6BueUvKkwcWAZ_C1n4=4xpECg@mail.gmail.com>
URL: https://gitlist.dev/e/CAAqgmoP2uyd5_k-JDOBpBV8ay6BueUvKkwcWAZ_C1n4%3D4xpECg%40mail.gmail.com

```
Hello,

I have my git repositories behind an apache server configured with
kerberos. Works fine if the user is logged in on their workstation.
Apache gets the kerberos credential, and validates, and  then sends
the GIT repo being requested.

BUT, I want to write a script on linux that will also pass the
kerberos credential to the apache GIT server without having any
manually intervention. Seems I would create a kerberos keytab for the
principal and then use that to authenticate.... kinit supports
authenticating from a keytab using the -k -t <keytab-path> options,
but has anyone done this?

Keith

```

## Randall S. Becker, 2017-04-03 16:20

Subject: RE: How do you script linux GIT client to pass kerberos credential to apache enabled GIT server?
Message-ID: <002501d2ac96$42a272a0$c7e757e0$@nexbridge.com>
URL: https://gitlist.dev/e/002501d2ac96%2442a272a0%24c7e757e0%24%40nexbridge.com
In-Reply-To: <CAAqgmoP2uyd5_k-JDOBpBV8ay6BueUvKkwcWAZ_C1n4=4xpECg@mail.gmail.com>

```
-----Original Message-----
On April 3, 2017 12:04 PM, Ken Edward Wrote:
>I have my git repositories behind an apache server configured with kerberos. Works fine if the user is logged in on their workstation.
>Apache gets the kerberos credential, and validates, and  then sends the GIT repo being requested.
>BUT, I want to write a script on linux that will also pass the kerberos credential to the apache GIT server without having any manually intervention. Seems I would create a kerberos keytab for the principal and then use that to >authenticate.... kinit supports authenticating from a keytab using the -k -t <keytab-path> options, but has anyone done this?

Have you attempted prototyping this using curl? It might be able to help out a bit. I have done this in the past with Stash and their REST and credentials, but not using Kerberos. Just a thought.
Cheers,

Randall


```

## Mantas Mikulėnas, 2017-04-04 10:12

Subject: Re: How do you script linux GIT client to pass kerberos credential to apache enabled GIT server?
Message-ID: <7ab9e033-906f-f1ec-f89a-952346e98651@gmail.com>
URL: https://gitlist.dev/e/7ab9e033-906f-f1ec-f89a-952346e98651%40gmail.com
In-Reply-To: <CAAqgmoP2uyd5_k-JDOBpBV8ay6BueUvKkwcWAZ_C1n4=4xpECg@mail.gmail.com>

```
On 2017-04-03 19:04, ken edward wrote:
> Hello,
> 
> I have my git repositories behind an apache server configured with
> kerberos. Works fine if the user is logged in on their workstation.
> Apache gets the kerberos credential, and validates, and  then sends
> the GIT repo being requested.
> 
> BUT, I want to write a script on linux that will also pass the
> kerberos credential to the apache GIT server without having any
> manually intervention. Seems I would create a kerberos keytab for the
> principal and then use that to authenticate.... kinit supports
> authenticating from a keytab using the -k -t <keytab-path> options,

kinit works, but I think kstart [1] is commonly used for this as well;
takes care of automatic ticket renewal.

ktutil should be able to create a keytab based on your password, but
I've had mixed luck with that. Though still probably easier than
creating a separate instance just for batch tasks...

[1]: https://www.eyrie.org/~eagle/software/kstart/

-- 
Mantas Mikulėnas <grawity@gmail.com>

```
