Please forgive me if this is "obvious" but this is my first venture into setting up Kerberos.
The end goal for me is to be able to have NFSv4 be able to properly recognize the user jeff as the same person, no matter if the mount is on FreeBSD, Mac OS X, or Ubuntu. As I understand it, properly setting up Kerberos will mitigate the ancient UID/GID mapping problems.
Rather than complicating things with integration of MIT Kerberos with FreeBSD, I decided to start off with the as-shipped Kerberos tools. I may shift over to security/krb5 in the future, but, for now, at least I'm under the belief that the Kerberos is "properly" integrated with the various bits of FreeBSD, be it things like PAM or standard utilities, like ssh.
To this end, I've set up Kerberos on a build of 10.1-STABLE FreeBSD 10.1-STABLE #1 r279921 using the instructions at https://www.freebsd.org/doc/en/books/handbook/kerberos5.html (with the changes to /etc/rc.conf variable names to the current
This machine has various DNS mappings in two domains, call them b-domain.com and w-domain.com for now. So all of the following resolve to the host's IP address:
The Kerberos realm is B-DOMAIN.COM
/etc/krb5.conf contains
I've set up principals for myself, both as a user and as an admin.
I'm able to obtain TGT as either, as well as to run
I've created and believe properly exported host keys for each of the DNS names above.
I can successfully use
My first "quick check" was to see if I could use GSSAPI to authenticate an ssh session to the local host.
I've updated /etc/sshd_conf and /etc/ssh_conf to use
If I run
However, any of the other hostnames fail (without anything useful in the ssh -v output) and move on to password authentication. Using the host's IP address didn't resolve this (thinking that ssh was asking for credentials based on the target host's concept of its own name).
I see host-type credentials for all DNS names used present in the output of
This leaves me with a couple questions that I haven't been able to find in the Handbook,
Any guidance to additional resources, especially as I move on to NFSv4, would be appreciated as well. It seems that Kerberos: The Definitive Guide isn't so definitive any more, with it not even appearing in O'Reilly's Safari Books Online at this time.
The end goal for me is to be able to have NFSv4 be able to properly recognize the user jeff as the same person, no matter if the mount is on FreeBSD, Mac OS X, or Ubuntu. As I understand it, properly setting up Kerberos will mitigate the ancient UID/GID mapping problems.
Rather than complicating things with integration of MIT Kerberos with FreeBSD, I decided to start off with the as-shipped Kerberos tools. I may shift over to security/krb5 in the future, but, for now, at least I'm under the belief that the Kerberos is "properly" integrated with the various bits of FreeBSD, be it things like PAM or standard utilities, like ssh.
To this end, I've set up Kerberos on a build of 10.1-STABLE FreeBSD 10.1-STABLE #1 r279921 using the instructions at https://www.freebsd.org/doc/en/books/handbook/kerberos5.html (with the changes to /etc/rc.conf variable names to the current
kdc_enable="YES" and kadmind_enable="YES")This machine has various DNS mappings in two domains, call them b-domain.com and w-domain.com for now. So all of the following resolve to the host's IP address:
- 13.b-domain.com
- port13.b-domain.com
- port13.pn.w-domain.com
hostname returns.The Kerberos realm is B-DOMAIN.COM
/etc/krb5.conf contains
Code:
[domain_realm]
.b-domain.com = B-DOMAIN.COM
.w-domain.com = B-DOMAIN.COM
I'm able to obtain TGT as either, as well as to run
kadmin with the admin credential.I've created and believe properly exported host keys for each of the DNS names above.
I can successfully use
kinit with either my user or admin principal.My first "quick check" was to see if I could use GSSAPI to authenticate an ssh session to the local host.
I've updated /etc/sshd_conf and /etc/ssh_conf to use
GSSAPIAuthentication yes in both cases. I've turned off cleanup with GSSAPICleanupCredentials no so that I can see what was created along the way.If I run
ssh -v jeff@port13.pn.w-domain.com it will log me in using Kerberos.However, any of the other hostnames fail (without anything useful in the ssh -v output) and move on to password authentication. Using the host's IP address didn't resolve this (thinking that ssh was asking for credentials based on the target host's concept of its own name).
I see host-type credentials for all DNS names used present in the output of
klist:
Code:
[jeff@port13 ~]$ klist
Credentials cache: FILE:/tmp/krb5cc_1001
Principal: jeff@B-DOMAIN.COM
Issued Expires Principal
Mar 15 02:48:30 2015 Mar 15 12:48:30 2015 krbtgt/B-DOMAIN.COM@B-DOMAIN.COM
Mar 15 03:42:54 2015 Mar 15 12:48:30 2015 host/13.b-domain.com@B-DOMAIN.COM
Mar 15 03:46:30 2015 Mar 15 12:48:30 2015 host/port13.b-domain.com@B-DOMAIN.COM
Mar 15 03:47:27 2015 Mar 15 12:48:30 2015 host/port13.pn.w-domain.com@B-DOMAIN.COM
This leaves me with a couple questions that I haven't been able to find in the Handbook,
info heimdal or searching the web:How does ssh (or a service, in general) determine the credential(s) requested/used for a given command-line connection request?
What am I missing in my configuration that is preventing ssh from successfully using GSSAPI authentication for the other host names?
What am I missing in my configuration that is preventing ssh from successfully using GSSAPI authentication for the other host names?
Any guidance to additional resources, especially as I move on to NFSv4, would be appreciated as well. It seems that Kerberos: The Definitive Guide isn't so definitive any more, with it not even appearing in O'Reilly's Safari Books Online at this time.