Just talking to myself here (making notes). I'm really starting to like this Fedora Directory server. I have now mapped my passwd and group files so it's working very much like the old days when I used to use NIS on AIX, Solaris and Linux. So now if you have a Directory account you can log in to any of the servers I have connected to the directory with your LDAP ID and password. At first I imported all the IDs and groups including system IDs and groups but I decided to just keep login users and groups in the directory so the other ids/groups can be manipulated on a local level. So to summarize what I have done:
On Directory Server:
1 - Installed version 1.0.4 of the Fedora Directory Server on F7 (from FC6 RPM):
http://directory.fedoraproject.org/wiki/Download
2 - Set up FDS to use SSL by running the "
first script" linked on the SSL howto page:
http://directory.fedoraproject.org/wiki ... SSL#Script
3 - Imported my user and group accounts into the directory from the /etc/passwd and group files using the
LdapImport Perl utility found here:
http://directory.fedoraproject.org/wiki ... rateToLDAP
IMPORTANT NOTE 1: It's supposed to import the passwords as well but for some reason the passwords didn't make it across properly and I had to reset them in the GUI. Not a big deal at home where I only have a handful of users but if I were doing this in a production environment I would have to figure out and fix that issue.
IMPORTANT NOTE 2: When importing it will ask you where you want to put the data in your directory. It defaults to the NetscapeRoot which is not where you want the data to go. You want it to go under your user database. In my case I entered this when prompted:
ou=People,dc=voidmain, dc=home
Here is a message about it:
http://www.redhat.com/archives/fedora-d ... 00101.html
On Each Directory Client:
1 - Set up LDAP tools to use the directory by default by editing the /etc/openldap/ldap.conf to contain:
- Code: Select all
BASE dc=voidmain,dc=home
URI ldaps://fds.voidmain.home/
TLS_CACERTDIR /etc/openldap/cacerts
TLS_CACERTFILE /etc/openldap/cacerts/cacert.asc
TLS_REQCERT allow
Of course change "fds.voidmain.home" and "voidmain.home" your fully qualified hostname and domain where your directory lives. Also copy the server cert /opt/fedora-ds/alias/cacert.asc to /etc/openldap/cacerts
2 - Set up your systems to authenticate against the directory by first editing /etc/ldap.conf to contain:
- Code: Select all
host fds.voidmain.home
base dc=voidmain,dc=home
nss_initgroups_ignoreusers root,ldap,named,avahi,haldaemon
pam_password md5
uri ldaps://fds.voidmain.home
TLS_CACERTDIR /etc/openldap/cacerts
TLS_CACERTFILE /etc/openldap/cacerts/cacert.asc
TLS_REQCERT allow
Same thing, change fds.voidmain.home and voidmain.home to whatever your host/domain are that contain your directory.
And then add the ldap lines to your /etc/pam.d/system-auth file. Notice I added/inserted 4 pam_ldap.so lines to my F7 auth file:
- Code: Select all
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth sufficient pam_ldap.so use_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
account required pam_unix.so
account sufficient pam_succeed_if.so uid < 500 quiet
account [default=bad success=ok user_unknown=ignore] pam_ldap.so
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3
password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok
password sufficient pam_ldap.so use_authtok
password required pam_deny.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
session optional pam_ldap.so
3 - You want all your UID and GIDs to be the same on all machines that you want to map the passwd and group files on so if they don't match across machines there is another script called
UidFixup also found at the above link that will adjust your UID/GID numbers in the passwd and group files and search the hard drive for files owned by that user and change ownership to the new ID:
http://directory.fedoraproject.org/wiki ... rateToLDAP4 - Map your /etc/passwd, /etc/shadow and /etc/group to the directory by editing your /etc/nsswitch.conf file and adding "ldap" to your passwd, shadow, and and group lines:
- Code: Select all
passwd: files ldap
shadow: files ldap
group: files ldap
Now a user doesn't even have to have an account on the actual machine to log in if that machine has it's passwd, shadow, and group files mapped.
----
Things I have not yet had to deal with but are common issues:
- you'll want to make sure you don't have clashing UID and GID numbers between the directory users and the local passwd and group files.
- I'm not sure what the best method of creating a new account would be. I normally just use the "adduser" command on standalone machines. You would want a similar command that adds a user to the directory with a unique UID and GID and optionally add that to the local passwd and group files and create the home directory for the user on one or more of the machines you have participating.
What I did in the old days of NIS (YP) is to use NFS and automount. You had a master server where everyones home directory actually resided and then it would get automatically NFS mounted on any other machine they logged. That may or may not still be the best way to do it. I guess it will depend on the environment that you are setting this up in. If all the machines are configured identically and any user could use any one of them at any time that may be the best way to do it (automounted home directories).
It seems to be very flexible in that it's not all or nothing. That is you don't have to map the passwd and group files and can set up for authentication only. Or you can just use it as a regular ldap server.
The directory can obviously be used for much more than user authentication. I also pointed my Evolution address book to it and you can use it like any other LDAP database. I also am doing my squid authentication against the directory using squid_ldap_auth (included with the squid server).
I also have yet to set up a secondary server that will sync with the primary. I think that's the next thing I need to work on.
That's all for now. It almost looks like a first step to my next Fedora tip. After learning more about Fedora Directory server I might just see about implementing this at work to better manage all of our Linux, Solaris, and AIX servers. I've actually been working on setting them up with Radius authentication against our Cisco Secure ACS servers which will be backened with AD accounts for encryption capable devices and servers and two factor RSA SecurID authentication for devices not encryption capable. I think Fedora Directory Server would give us a much more manageable environment than just centralized password management.