Merge lp:~markthomas/serverguide/serverguide-review-7.5 into lp:serverguide/trunk

Proposed by Mark Thomas
Status: Merged
Merged at revision: 243
Proposed branch: lp:~markthomas/serverguide/serverguide-review-7.5
Merge into: lp:serverguide/trunk
Diff against target: 223 lines (+215/-0)
1 file modified
serverguide/C/network-auth.xml (+215/-0)
To merge this branch: bzr merge lp:~markthomas/serverguide/serverguide-review-7.5
Reviewer Review Type Date Requested Status
Peter Matulis Approve
Review via email: mp+249727@code.launchpad.net

Description of the change

This is a new section describing how to configure Trusty to authenticate against Active Directory with sssd. It did not fit into any previously-existing section (i.e. no section for sssd existed).

To post a comment you must log in.
Revision history for this message
Doug Smythies (dsmythies) wrote :

Peter: Do you want to try to include this one in our pending point release, for which string freeze is tomorrow? It looks pretty good to me.

Revision history for this message
Peter Matulis (petermatulis) wrote :

A wonderful contribution! Thank you Mark. A few comments below.

1. wording

(a)
"This section covers the use of sssd to authenticate user logins against an Active Directory via sssd and PAM using sssd's "ad" provider."

Maybe:

"This section describes the use of sssd and PAM for authenticating users against Microsoft Active Directory."

(b)
"This guide assumes that a working Active Directory domain already configured."

Maybe:

"This guide assumes that a working Active Directory domain is already configured.

(c)
"The domain and kerberos realm used in this example is myubuntu.example.com ."

Maybe the realm should be in all caps. You mention both domain and realm so not sure.

(d)
"Add an alias /etc/hosts specifying the FQDN."

Maybe:

"Add an entry to /etc/hosts for specifying the FQDN."

(e)
"kerberos" should be capitalized everywhere: Kerberos.

2. format

(a) All commands should be formatted like so:

<screen>
<command>command_goes_here</command>
</screen>

(b) All filenames should be formatted like so:

<filename>file_goes_here</filename>

(c) References should be hyperlinks. See end of this page as an exemplar:

https://help.ubuntu.com/14.04/serverguide/openldap-server.html

Long ugly URLs should also not be exposed to the reader.

review: Needs Fixing
Revision history for this message
Doug Smythies (dsmythies) wrote :

Mark: Are you going to get to this today or tomorrow? We are wanting to do a point release of the serverguide, and had originally intended string freeze for yesterday. String freeze will be pushed at least until tomorrow now. If you cannot get to this, I will fix it.

Revision history for this message
Doug Smythies (dsmythies) wrote :

Mark: What is the status of this?

Revision history for this message
Mark Thomas (markthomas) wrote :

I never received a notification on this for some reason. I will be addressing this ASAP.

238. By Mark Thomas

Changes based on feedback in LP

Revision history for this message
Mark Thomas (markthomas) wrote :

Content changes:

(a) I implemented a variation of that change. It is important to highlight that the “ad” provider is what is being covered—the use of the “ldap” provider in sssd for AD authentication is quite different, older, and more difficult. I did omit the name “Microsoft”, as it is also possible to use Samba4 as an AD domain controller. Do you think it is needed?

(b) Fixed

(c) Modified for clarification. I am not trying to specify formatting—that is covered soon after. I am providing the value used rather than have it just “show up” as I’ve seen in other documentation.

One thing I did here was to use a “subdomain” for the Active Directory domain. So often, I see just “example.com”. If someone wants to implement the AD domain as a subdomain, as is often done, I didn’t want it left an an exercise for the reader to figure out what the realm should be by “trial and error” as I’ve had to do.

(d) Modified for clarification.

(e) Fixed

2. format

(a) Fixed
(b) Fixed
(c) Fixed

Revision history for this message
Peter Matulis (petermatulis) wrote :

Looks good!

review: Approve
Revision history for this message
Doug Smythies (dsmythies) wrote :

Mark, Thanks very much.

Peter: O.K. we will now call 12.04 and trunk (14.04) serverguides as in string freeze until the point release is done.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'serverguide/C/network-auth.xml'
2--- serverguide/C/network-auth.xml 2015-02-25 16:19:47 +0000
3+++ serverguide/C/network-auth.xml 2015-02-26 19:58:31 +0000
4@@ -3969,4 +3969,219 @@
5
6 </sect2>
7 </sect1>
8+ <sect1 id="sssd-ad" status="review">
9+ <title>SSSD and Active Directory</title>
10+ <para>
11+ This section describes the use of sssd to authenticate user logins against an Active Directory via using sssd's "ad" provider. In previous versions of sssd, it was possible to authenticate using the "ldap" provider. However, when authenticating against a Microsoft Windows AD Domain Controller, it was generally necessary to install the POSIX AD extensions on the Domain Controller. The "ad" provider simplifies the configuration and requires no modifications to the AD structure.
12+ </para>
13+ <sect2 id="sssd-ad-requirements" status="review">
14+ <title>Prerequisites, Assumptions, and Requirements</title>
15+ <itemizedlist>
16+ <listitem>
17+ <para>This guide does not explain Active Directory, how it works, how to set one up, or how to maintain it. It may not provide “best practices” for your environment.</para></listitem>
18+ <listitem>
19+ <para>This guide assumes that a working Active Directory domain is already configured.</para></listitem>
20+ <listitem>
21+ <para>The domain controller is acting as an authoritative DNS server for the domain.</para></listitem>
22+ <listitem>
23+ <para>The domain controller is the primary DNS resolver as specified in <filename>/etc/resolv.conf</filename>.</para>
24+ </listitem>
25+ <listitem>
26+ <para>The appropriate <emphasis>_kerberos</emphasis>, <emphasis>_ldap</emphasis>, <emphasis>_kpasswd</emphasis>, etc. entries are configured in the DNS zone (see Resources section for external links).</para></listitem>
27+ <listitem>
28+ <para>System time is synchronized on the domain controller (necessary for Kerberos).</para></listitem>
29+ <listitem>
30+ <para>The domain used in this example is <emphasis>myubuntu.example.com</emphasis> .</para></listitem>
31+ </itemizedlist>
32+ </sect2>
33+ <sect2 id="sssd-ad-installation" status="review">
34+ <title>Software Installation</title>
35+ <para>The following packages are needed: <emphasis>krb5-user</emphasis>, <emphasis>samba</emphasis>, <emphasis>sssd</emphasis>, and <emphasis>ntp</emphasis>. Samba needs to be installed, even if the system is not exporting shares. The Kerberos realm and FQDN or IP of the domain controllers are needed for this step.</para>
36+ <para>Install these packages now.
37+ </para>
38+ <screen><command>sudo apt-get install krb5-user samba sssd ntp</command></screen>
39+ <para>See the next section for the answers to the questions asked by the <emphasis>krb5-user</emphasis> postinstall script.</para>
40+ </sect2>
41+ <sect2 id="sssd-ad-kerberos" status="review">
42+ <title>Kerberos Configuration</title>
43+ <para>The installation of <emphasis>krb5-user</emphasis> will prompt for the realm name (in ALL UPPERCASE), the kdc server (i.e. domain controller) and admin server (also the domain controller in this example.) This will write the [realm] and [domain_realm] sections in <filename>/etc/krb5.conf</filename>. These sections may not be necessary if domain autodiscovery is working. If not, then both are needed.</para>
44+ <para>If the domain is <emphasis>myubuntu.example.com</emphasis>, enter the realm as <emphasis>MYUBUNTU.EXAMPLE.COM</emphasis>
45+ </para>
46+
47+ <para>Optionally, edit <emphasis>/etc/krb5.conf</emphasis> with a few additional settings to specify Kerberos ticket lifetime (these values are safe to use as defaults):</para>
48+ <programlisting>
49+[libdefaults]
50+
51+default_realm = MYUBUNTU.EXAMPLE.COM
52+ticket_lifetime = 24h #
53+renew_lifetime = 7d
54+ </programlisting>
55+
56+ <para>If default_realm is not specified, it may be necessary to log in with “username@domain” instead of “username”.</para>
57+
58+ <para>The system time on the Active Directory member needs to be consistent with that of the domain controller, or Kerberos authentication may fail. Ideally, the domain controller server itself will provide the NTP service. Edit <filename>/etc/ntp.conf</filename>:</para>
59+
60+<programlisting>
61+server dc.myubuntu.example.com
62+</programlisting>
63+
64+ </sect2>
65+ <sect2 id="sssd-ad-samba" status="review">
66+ <title>Samba Configuration</title>
67+<para>Samba will be used to perform netbios/nmbd services related to Active Directory authentication, even if no file shares are exported. Edit the file /etc/samba/smb.conf and add the following to the <emphasis>[global]</emphasis> section:</para>
68+
69+<programlisting>
70+[global]
71+
72+workgroup = MYUBUNTU
73+client signing = yes
74+client use spnego = yes
75+kerberos method = secrets and keytab
76+realm = MYUBUNTU.EXAMPLE.COM
77+security = ads
78+</programlisting>
79+
80+<note><para>Some guides specify that "password server" should be specified and pointed to the domain controller. This is only necessary if DNS is not properly set up to find the DC. By default, Samba will display a warning if "password server" is specified with "security = ads".</para></note>
81+
82+</sect2>
83+
84+<sect2 id="sssd-ad-sssdconfig" status="review">
85+ <title>SSSD Configuration</title>
86+
87+<para>There is no default/example config file for <filename>/etc/sssd/sssd.conf</filename> included in the sssd package. It is necessary to create one. This is a minimal working config file:</para>
88+
89+<programlisting>
90+[sssd]
91+services = nss, pam
92+config_file_version = 2
93+domains = MYUBUNTU.EXAMPLE.COM
94+
95+[domain/MYUBUNTU.EXAMPLE.COM]
96+id_provider = ad
97+access_provider = ad
98+
99+# Use this if users are being logged in at /.
100+# This example specifies /home/DOMAIN-FQDN/user as $HOME. Use with pam_mkhomedir.so
101+override_homedir = /home/%d/%u
102+
103+# Uncomment if the client machine hostname doesn't match the computer object on the DC.
104+# ad_hostname = mymachine.myubuntu.example.com
105+
106+# Uncomment if DNS SRV resolution is not working
107+# ad_server = dc.mydomain.example.com
108+
109+# Uncomment if the AD domain is named differently than the Samba domain
110+# ad_domain = MYUBUNTU.EXAMPLE.COM
111+
112+# Enumeration is discouraged for performance reasons.
113+# enumerate = true
114+</programlisting>
115+
116+<para>After saving this file, set the ownership to root and the file permissions to 600:</para>
117+<screen><command>sudo chown root:root /etc/sssd/sssd.conf</command></screen>
118+<screen><command>sudo chmod 600 /etc/sssd/sssd.conf</command></screen>
119+
120+<para>If the ownership or permissions are not correct, sssd will refuse to start.</para>
121+</sect2>
122+
123+<sect2 id="sssd-ad-nsswitch" status="review">
124+ <title>Verify nsswitch.conf Configuration</title>
125+ <para>The post-install script for the sssd package makes some modifications to /etc/nsswitch.conf automatically. It should look something like this:</para>
126+
127+<programlisting>
128+passwd: compat sss
129+group: compat sss
130+...
131+netgroup: nis sss
132+sudoers: files sss
133+</programlisting>
134+</sect2>
135+
136+<sect2 id="sssd-ad-hosts" status="review">
137+ <title>Modify /etc/hosts</title>
138+<para>Add an alias to the localhost entry in /etc/hosts specifying the FQDN. For example:</para>
139+<programlisting>192.168.1.10 myserver myserver.myubuntu.example.com</programlisting>
140+
141+<para>This is useful in conjunction with dynamic DNS updates.</para>
142+</sect2>
143+
144+<sect2 id="sssd-ad-join" status="review">
145+ <title>Join the Active Directory</title>
146+<para>Now, restart ntp and samba and start sssd.</para>
147+<screen><command>sudo service ntp restart</command>
148+<command>sudo restart smbd</command>
149+<command>sudo restart nmbd</command>
150+<command>sudo start sssd</command></screen>
151+
152+<para>Test the configuration by obtaining a Kerberos ticket:</para>
153+
154+<screen><command>sudo kinit Administrator</command></screen>
155+
156+<para>Verify the ticket with:</para>
157+<screen><command>sudo klist</command></screen>
158+
159+<para>If there is a ticket with an expiration date listed, then it is time to join the domain:</para>
160+
161+<screen><command>sudo net ads join -k</command></screen>
162+
163+<para>A warning about "No DNS domain configured. Unable to perform DNS Update." probably means that there is no (correct) alias in <filename>/etc/hosts</filename>, and the system could not provide its own FQDN as part of the Active Directory update. This is needed for dynamic DNS updates. Verify the alias in <filename>/etc/hosts</filename> described in "Modify /etc/hosts" above.</para>
164+
165+<para>(The message "NT_STATUS_UNSUCCESSFUL" indicates the domain join failed and something is incorrect. Review the prior steps before proceeding).</para>
166+
167+<para>Here are a couple of (optional) checks to verify that the domain join was successful. Note that if the domain was successfully joined but one or both of these steps fail, it may be necessary to wait 1-2 minutes and try again. Some of the changes appear to be asynchronous.</para>
168+
169+<para>Verification option #1:</para>
170+<para>Check the default Organizational Unit for computer accounts in the Active Directory to verify that the computer account was created. (Organizational Units in Active Directory is a topic outside the scope of this guide).</para>
171+
172+<para>Verification option #2</para>
173+<para>Execute this command for a specific AD user (e.g. administrator)</para>
174+<screen><command>getent passwd username</command></screen>
175+
176+<note><para>If <emphasis>enumerate = true</emphasis> is set in <filename>sssd.conf</filename>, <emphasis>getent passwd</emphasis> with no username argument will list all domain users. This may be useful for testing, but is slow and not recommended for production.</para></note>
177+</sect2>
178+
179+<sect2 id="sssd-ad-test" status="review">
180+ <title>Test Authentication</title>
181+ <para>It should now be possible to authenticate using an Active Directory User's credentials:</para>
182+
183+<screen><command>su - username</command></screen>
184+
185+<para>If this works, then other login methods (getty, ssh) should also work.</para>
186+
187+<para>If the computer account was created, indicating that the system was "joined" to the domain, but authentication is unsuccessful, it may be helpful to review <filename>/etc/pam.d</filename> and <filename>nssswitch.conf</filename> as well as the file changes described earlier in this guide.</para>
188+</sect2>
189+
190+<sect2 id="sssd-ad-mkhomedir" status="review">
191+ <title>Home directories with pam_mkhomedir (optional)</title>
192+ <para>When logging in using an Active Directory user account, it is likely that user has no home directory. This can be fixed with pam_mkdhomedir.so, which will create the user’s home directory on login. Edit <filename>/etc/pam.d/common-session</filename>, and add this line directly after <emphasis>session required pam_unix.so:</emphasis></para>
193+<programlisting>
194+session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
195+</programlisting>
196+
197+<note><para>This may also need <emphasis>override_homedir</emphasis> in <filename>sssd.conf</filename> to function correctly, so make sure that’s set.</para></note>
198+</sect2>
199+
200+<sect2 id="sssd-ad-desktop" status="review">
201+ <title>Desktop Ubuntu Authentication</title>
202+ <para>It is possible to also authenticate logins to Ubuntu Desktop using Active Directory accounts. The AD accounts will not show up in the pick list with local users, so lightdm will need to be modified. Edit the file <filename>/etc/lightdm/lightdm.conf.d/50-unity-greeter.conf</filename> and append the following two lines:</para>
203+
204+<programlisting>
205+greeter-show-manual-login=true
206+greeter-hide-users=true
207+</programlisting>
208+
209+<para>Reboot to restart lightdm. It should now be possible to log in using a domain account using either <emphasis>username</emphasis> or <emphasis>username/username@domain</emphasis> format.</para>
210+</sect2>
211+
212+<sect2 id="sssd-ad-resources" status="review">
213+ <title>Resources</title>
214+ <itemizedlist>
215+ <listitem><para><ulink url="https://fedorahosted.org/sssd">SSSD Project</ulink></para></listitem>
216+<listitem><para><ulink url="http://www.ucs.cam.ac.uk/support/windows-support/winsuptech/activedir/dnsconfig">DNS Server Configuration guidelines</ulink></para></listitem>
217+<listitem><para><ulink url="https://technet.microsoft.com/en-us/library/cc759550%28v=ws.10%29.aspx">Active Directory DNS Zone Entries</ulink></para></listitem>
218+<listitem><para><ulink url="http://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html">Kerberos config options</ulink></para></listitem>
219+ </itemizedlist>
220+
221+</sect2>
222+</sect1>
223 </chapter>

Subscribers

People subscribed via source and target branches