I want to have an embedded device join a Linux based AD/DC domain. I have kerberos libraries (no executables) on the embedded device. I have an application on the embedded device that can successfully authenticate and access services on the domain as a client. What I also want to do is have the embedded device join the domain as a member, to acquire credentials, and to accept authentication requests from domain users.
I've been using the sample program gss-server from the kerberos src/appl/gss-sample directory as a model for integrating the server functionality to my application.
HINT: I posted my solution as an answer to this question.
I am missing an important piece. Before the embedded device can offer kerberos services, it must join the domain, which, as I understand it, involves a) creating a principal for the host, b) adding an entry into the device's keytab, and c) adding a corresponding entry on the domain controllers keytab. If I were running a full samba stack on my device, I would use something like samba-tool domain join
or net ads join
. I have looked at the code for samba-tool and net and they seem to do a lot more than I need or want. For the most part, I believe all I need to do is add the artifacts that allow the embedded device to authenticate with the DC. I really don't know if I'm going about this right and I don't believe I know all the steps. But here's what I believe I'm trying to do:
- provision a computer on the DC
- Export the keytab entry from the DC
- Import the keytab entry on the emdedded device.
After doing the above three steps, presumably I could run gss-client/gss-server successfully. First question: Is that correct? And is it the way to do this? Second question: How do I import a keytab entry?
Maybe I don't need a keytab but rather instead of using gss_acquire_cred, I somehow export the credential from the DC and securely communicate it to the embedded device and then use gss_import_cred.
Does anyone know if I'm on the right track? Is there any sample code they know about that does this?
As some background, we have a commercial SMB client/server stack that runs on Android. We support both NTLM and Kerberos authentication for the client and just NTLM on the server. We are trying to upgrade the server to support Kerberos authentication as well.