This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[samba.git] / docs / textdocs / ADS-HOWTO.txt
1 Samba 3.0 prealpha guide to Kerberos authentication
2 ---------------------------------------------------
3
4 Andrew Tridgell
5 tridge@samba.org
6
7 This is a VERY ROUGH guide to setting up the current (November 2001)
8 pre-alpha version of Samba 3.0 with kerberos authentication against a
9 Windows2000 KDC. The procedures listed here are likely to change as
10 the code develops.
11
12 Pieces you need before you begin:
13
14 - a Windows 2000 server 
15 - the latest CVS source code for Samba. See http://cvs.samba.org/ for how to
16   fetch this.
17 - the MIT kerberos development libraries (either install from the
18   above sources or use a package). Under debian you need "libkrb5-dev"
19   and "krb5-user". The heimdal libraries will not work.
20 - the OpenLDAP development libraries. 
21
22 On RedHat this means you should have at least: 
23
24 krb5-workstation (for kinit)
25 krb5-libs (for linking with)
26 krb5-devel (because you are compiling from source)
27
28 in addition to the standard development environment.
29
30 Note that these are not standard on a RedHat install, and you may need 
31 to get them off CD2.
32
33 Also check that you have the latest copy of this HOWTO. It is
34 available from http://samba.org/ftp/tridge/kerberos/HOWTO
35
36 Step 1: Compile Samba
37   
38   If your kerberos libraries are in a non-standard location then
39   remember to add the configure option --with-krb5=DIR. 
40
41   After you run configure make sure that include/config.h contains 
42   lines like this:
43
44   #define HAVE_KRB5 1
45   #define HAVE_LDAP 1
46
47   If it doesn't then configure did not find your krb5 libraries or
48   your ldap libraries. Look in config.log to figure out why and fix
49   it.
50
51   Then compile and install Samba as usual. You must use at least the
52   following 3 options in smb.conf:
53
54   realm = YOUR.KERBEROS.REALM
55   ads server = your.kerberos.server
56   security = ADS
57   encrypt passwords = yes
58
59   Strictly speaking, you can omit the realm name and you can use an IP
60   address for the ads server. In that case Samba will auto-detect these.
61
62   You do *not* need a smbpasswd file, although it won't do any harm
63   and if you have one then Samba will be able to fall back to normal
64   password security for older clients. I expect that the above
65   required options will change soon when we get better active
66   directory integration.
67
68
69 Step 2: Setup your /etc/krb5.conf
70
71   The minimal configuration for krb5.conf is:
72
73     [realms]
74     YOUR.KERBEROS.REALM = {
75         kdc = your.kerberos.server
76     }
77
78
79   Test your config by doing a "kinit USERNAME@REALM" and making sure that
80   your password is accepted by the Win2000 KDC. 
81
82   NOTE: The realm must be uppercase. 
83
84   You also must ensure that you can do a reverse DNS lookup on the IP
85   address of your KDC. Also, the name that this reverse lookup maps to
86   must either be the netbios name of the KDC (ie. the hostname with no
87   domain attached) or it can alternatively be the netbios name
88   followed by the realm. 
89
90   The easiest way to ensure you get this right is to add a /etc/hosts
91   entry mapping the IP address of your KDC to its netbios name. If you
92   don't get this right then you will get a "local error" when you try
93   to join the realm.
94
95 * If all you want is kerberos support in smbclient then you can skip
96 * straight to step 5 now. Step 3 is only needed if you want kerberos
97 * support in smbd.
98
99
100 Step 3: Create the computer account
101
102   Do a "kinit" as a user that has authority to change arbitrary
103   passwords on the KDC ("Administrator" is a good choice). Then as a
104   user that has write permission on the Samba private directory
105   (usually root) run:
106
107      net ads join
108
109   Possible errors:
110     - "bash: kinit: command not found":
111        - kinit is in the krb5-workstation RPM on RedHat systems, and is
112          in /usr/kerberos/bin, so it won't be in the path until 
113          you log in again (or open a new terminal)
114     - "ADS support not compiled in"
115        - Samba must be reconfigured (remove config.cache) and
116          recompiled (make clean all install) after the kerberos libs
117          and headers are installed.
118     
119
120 Step 4: Test your server setup
121
122   On a Windows 2000 client try "net use * \\server\share". You should
123   be logged in with kerberos without needing to know a password. If
124   this fails then run "klist tickets". Did you get a ticket for the
125   server? Does it have an encoding type of DES-CBC-MD5 ? 
126
127 Step 5: Testing with smbclient
128
129   On your Samba server try to login to a Win2000 server or your Samba
130   server using smbclient and kerberos. Use smbclient as usual, but
131   specify the -k option to choose kerberos authentication.
132
133
134 --------
135
136 NOTES: 
137  - must change administrator password at least once after DC install,
138  to create the right encoding types
139
140  - w2k doesn't seem to create the _kerberos._udp and _ldap._tcp in
141    their defaults DNS setup. Maybe fixed in service packs?
142