-
Notifications
You must be signed in to change notification settings - Fork 3
Setting up a file server
Return to main: Kerberos
This is documentation for how edinburgh is set up. It is an Aberdeen file server. It currently uses a slightly tailored Centos 6 system. Centos 6 is new enough to support NFS 4 with Kerberos. It does not support two factor authentication, but it doesn't need to, since users will authenticate on a client system. Once you've authenticated with 2FA, your ticket is like any other Kerberos ticket, so you can ssh and use NFS whether the other machine understands 2FA or not.
NFS v3 without Kerberos sends the user's current uid, gid, and list of groups. The server checks whether a file is accessible, but it believes that data. So the server doesn't need any knowledge of its own about the user. Everything it needs to check permission is in uid, gid, grouplist.
In addition, clients send the server uid and gid info when creating a file or doing chgrp, and the server sends info for "ls -l" and other purpose. That info is exchanged as numerical group and user ids.
Kerberos and NFS v4 change both of these. Kerberos sends the Kerberos principal, but not the current uid, gid and grouplist. To check accessibility, the server must be able to translate the principal to a uid, and must be able to find what groups that user is a member of.
Kerberos and NFS v4 also translate uid and gid to strings and back, in both directions, for file create, chgrp, and ls -l. That means that the server must know all uids and groups in use on the file system.
However NFS v4 also permit the user and group strings to be numerical identifiers passed as strings. That's a later addition to v4. Initially, names were used even without Kerberos. However that created inconsistencies. Without Kerberos, v4 was sending uid, gid and group list as numbers for access checking, but expecting translation to names for ls -l and setting user/group at file creation. In a later addition to the protocol, v4 when Kerberos is not used may pass users and groups as numbers. There's a kernel parameters in the Linux kernel to control whether numbers or names are sent for V4 without Kerberos. With Kerberos, the protocol requires names to be used. I believe the default setting for recent kernels is to use numbers without Kerberos.
Here are the combinations:
- v3, no Kerberos: access checking based on uid, gid, group list; user and group passed as numbers
- v3, Kerberos: access checking based on Kerberos principal, user and group passed as numbers
- v4, no Kerberos, original: access checking based on uid, gid, group list; user and group passed as names
- v4, no Kerberos, revised: access checking based on uid, gid, group list; user and group passed as numbers in string form
- v4, Kerberos: access checking based on Kerberos principal, user and group passed as names
- in /etc/sysconfig/nfs, set secure NFS, comment -N 4, which disables NFSv4
- in /etc/idmapd.conf, put cs.rutgers.edu as domain [note:]
- add /etc/krb5.keytab. This must have entries for both host/FQDN and nfs/FQDN
- put our verson of /etc/krb5.conf
/etc/ipa-ca.crt is a copy of the cert for the incommon CA
ca cert for kdc in /etc/ipa-ca.crt /etc/nslcd.conf — see below service nslcd start chkconfig nslcd on service nscd start chkconfig nscd on
Here nslcd.conf:
uri ldap://krb1.cs.rutgers.edu uri ldap://krb2.cs.rutgers.edu # this is what we should use but I haven't tested it #base cn=users,cn=accounts,dc=cs,dc=rutgers,dc=edu base dc=cs,dc=rutgers,dc=edu scope sub ssl start_tls tls_cacertfile /etc/ipa-ca.crt comment out the default settings at the end
If the primary is down, there will be a pause of over 10 sec the first time a user needs to be looked up. It appears to switch over after that.
To help you debug user issues, I created an ldap.conf that has all the right magic argument to access the LDAP server. Without that you need a ton of command-line arguments to specify the location of the server and how to get SSL to work. With this file the only argument you need is x. E.g. “ldapsearch -x uid=hedrick” willl find my entries.
Here's /etc/openldap/ldap.conf:
TLS_CACERTDIR /etc/openldap/cacerts URI ldaps://krb1.cs.rutgers.edu BASE dc=cs,dc=rutgers,dc=edu TLS_CACERT /etc/ipa-ca.crt