ActiveDirectory KDC » History » Version 1
Joseph Foley, 2015-09-05 02:55
1 | 1 | Joseph Foley | h1. ActiveDirectory KDC |
---|---|---|---|
2 | |||
3 | * Kerberos Explained http://technet.microsoft.com/en-us/library/bb742516.aspx |
||
4 | * Notes about using AD KDC with Openafs http://docs.openafs.org/ReleaseNotesWindows/ch03s02.html |
||
5 | * Derrick's Presentation on AD KDC for AFS http://workshop.openafs.org/afsbpw06/talks/shadow-AD.pdf |
||
6 | * Ktpass information: http://technet.microsoft.com/en-us/library/cc753771(ws.10).aspx |
||
7 | * How SPNs and instances work http://thejavamonkey.blogspot.com/2008/03/active-directory-and-kerberos-service.html |
||
8 | * Linux, openssh, Kerberos, AD http://blogs.technet.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-86-46-PDFs/3716.OpenSSH-on-Linux-using-Windows.pdf |
||
9 | * MS Kerberos debuggin http://technet.microsoft.com/en-us/library/bb463167.aspx |
||
10 | * Windows Security and Directory Services for UNIX guide http://www.microsoft.com/en-us/download/details.aspx?id=6899 |
||
11 | ** Of interest, Chapter 4, page 205 |
||
12 | * Iowa State guide (thanks to gendalia@iastate.edu) http://tech.its.iastate.edu/win2000/admin/Rhel6-AD-samba-winbind-keytab.pdf |
||
13 | * Backup AD http://technet.microsoft.com/library/cc771290(WS.10).aspx |
||
14 | * DNS records needed for AD http://technet.microsoft.com/en-us/library/bb727055.aspx |
||
15 | |||
16 | h2. Initial |
||
17 | |||
18 | * Install MS Server 2008 |
||
19 | * *Do not install the DNS Server unless you really need to.* |
||
20 | |||
21 | h2. Alternatives |
||
22 | |||
23 | * Apache Directory project http://directory.apache.org/ |
||
24 | |||
25 | h2. Creating instances |
||
26 | |||
27 | Separation of privileges in Kerberos needs multiple accounts. These are done by creating "instances" which |
||
28 | each control a subset. Replace _instance_ with the one you want. In this example, the user will be "foley", instance "root". |
||
29 | |||
30 | # Open Active Directory Users and Groups |
||
31 | # make the username: foley |
||
32 | ## Set the password to not need changing and not expire |
||
33 | # make the username: foley/root |
||
34 | # Make sure that the Name information reflects this being different than the primary account |
||
35 | # Give this account the administrator priviledges |
||
36 | |||
37 | h2. Allowing logins and administration on the server |
||
38 | |||
39 | # Open ActiveDirectory Users and Groups |
||
40 | # Right click on the user in question, and choose "Properties" |
||
41 | # Click on the "members-of" tab |
||
42 | # Add the user to the "Administrators" group. |
||
43 | # Note that you login with "foley.root" instead of "foley/root" |
||
44 | |||
45 | h2. Config |
||
46 | |||
47 | Starting with Windows 7 and Windows Server 2008 R2, Microsoft has disabled the single DES encryption type. Changes in Kerberos Authentication. DES must be enabled via Group Policy in order for Active Directory to be used as a KDC for OpenAFS. Enable weak encryption becuase of AFS... |
||
48 | We will also set the password requirements to be closer to an MIT KDC. |
||
49 | |||
50 | # Start > Administrative Tools > Group Policy Management |
||
51 | # Expand Forest > Domains > (domain name) |
||
52 | # Right-click "Create a GPO in this domain, and Link it here.." |
||
53 | # Make a new policy "AFS" |
||
54 | # "Edit" Expand "Computer Configuration" > "Policies" > "Windows Settings” > "Security Settings” > "Local Policies” > "Security Options” |
||
55 | # Double click "Network security: Configure encryption types allowed for Kerberos” |
||
56 | # Select "Define this policy setting", then select "DES_CBC_CRC" and all the others... Press "OK" (from the openafs.org guide) |
||
57 | # Expand "Computer configuration", "Windows Settings", "Security Settings", "Account Policies", "Password Policy" |
||
58 | ## Enforce password history: 2 |
||
59 | ## Minimum password length: 6 |
||
60 | ## Password must meet complexity requirements: Disabled |
||
61 | # Now put it at the top of the policy list so that it takes precedence |
||
62 | |||
63 | h3. AFS user/key |
||
64 | |||
65 | * Create an "afs" user. |
||
66 | ** Long password |
||
67 | ** Unchangable and never expires |
||
68 | * make the srvtab |
||
69 | <pre>ktpass -princ afs/afs.ru.is@RU.IS -mapuser afs -pass * -crypto DES-CBC-MD5 -out afs-ru.is-keytab</pre> |
||
70 | |||
71 | h2. Securely transferring the keytab |
||
72 | |||
73 | # Install cygwin |
||
74 | ## Make sure you install openssh in addition to the normal packages |
||
75 | # Copy the keytab somewhere useful |
||
76 | <pre>ssh afs-ru.is-keytab root@ruafs1.dev.ru.is:/usr/afs/etc/.</pre> |
||
77 | |||
78 | h2. Setting the time |
||
79 | |||
80 | For kerberos and AD to work properly, you need a good clock. We have one on @time.dev.ru.is@, use it. |
||
81 | |||
82 | Instructions on how to set an external sync at http://defaultreasoning.com/2009/11/16/synchronize-time-with-external-ntp-server-on-windows-server-2008-r2/ |
||
83 | |||
84 | # Open a powershell |
||
85 | # Figure out which is the PDC server and login to it as an Administrator |
||
86 | <pre>netdom /query fsmo</pre> |
||
87 | # Stop the W32Time service |
||
88 | <pre>net stop w32time</pre> |
||
89 | # Configure new time sources. You can put more, comma separated in quotes. |
||
90 | <pre>w32tm /config /syncfromflags:manual /manualpeerlist:"time.dev.ru.is"</pre> |
||
91 | # Make the PDC a reliable time source |
||
92 | <pre>w32tm /config /reliable:yes</pre> |
||
93 | # start it up |
||
94 | <pre>net start w32 time</pre> |
||
95 | # check to make sure that the config made it in and everything is ok |
||
96 | <pre>w32tm /query /configuration</pre> |
||
97 | |||
98 | h1. Keytabs |
||
99 | |||
100 | h2. On the AD KDC |
||
101 | |||
102 | * use ktpass |
||
103 | <pre>ktpass -out tmp -pass somepassword -princ host/njord.dev.ru.is@RU.IS -mapuser host_njord -ptype KRB5_NT_SRV_HST -crypto All</pre> |
||
104 | |||
105 | h2. Samba |
||
106 | |||
107 | https://help.ubuntu.com/community/ActiveDirectoryWinbindHowto |
||
108 | |||
109 | Refer to the windows guide for UNIX mentioned a the beginning |
||
110 | |||
111 | * To interface with AD more effectively, use Samba |
||
112 | <pre>sudo yum install samba samba-winbind</pre> |
||
113 | * Edit the /etc/samba/smb.conf |
||
114 | ** TODO |
||
115 | * And restart |
||
116 | <pre>service winbind stop |
||
117 | service smb restart |
||
118 | service winbind start</pre> |
||
119 | * Get kerberos tickets with Administrator group on the kdc |
||
120 | <pre>kinit foley/root@DEV.RU.IS</pre> |
||
121 | * Join the domain. Ignore the DNS error. You can use kerberos tickets to avoid typing passwords |
||
122 | <pre>net ads join -S stufur.dev.ru.is </pre> |
||
123 | # Setup a keytab |
||
124 | <pre>net ads keytab create</pre> |