3 AUTHOR: Succendo Fornacalis <succendo@atlaswebmail.com>
6 Installing Kerberos V on clients and the KDC
9 So, you want to run Kerberos eh? Or just curious what Kerberos is? Well in such
10 a case I will give you my explanation of Kerberos. Kerberos is an authentication
11 method developed by MIT that is based on tickets. Tickets, as you may know, are
12 used in place of the users password, as well as very strong encryption to
13 services like telnet. The Tickets are given out by a Key Distribution Center
14 (KDC) and then used for authenticating to any other server within it's realm.
15 So, in short, users send their password to the KDC, The KDC then gives them a
16 Ticket granting Ticket or TGT encrypted using their password as the key. If
17 their password is bad, then the TGT will be bogus. The TGT which expires at a
18 given time, permits the client to obtain additional tickets. This gives
19 permission to a specific service. If this hint is acward or just plain bad, let
20 me know, or if I just suck at explaining something let me know that too, and
21 I’ll make revision. I am, by no means, a writer so I’m sure this could be
22 better. And with that, good luck.
29 2. Installing Kerberos
32 5. Creating Bootscripts
35 Software used/mentioned/etc in this hint
36 ========================================
37 Kerberos V: http://web.MIT.edu/network/Kerberos-form.html
38 Samba 2.2.2: ftp://ftp.samba.org/pub/samba/samba-2.2.2.tar.gz
39 OpenSSL: http://www.openssl.org/source/openssl-0.9.6b.tar.gz
40 SSH: ftp://ftp.ssh.com/pub/ssh/ssh-3.0.1.tar.gz
45 /configure --prefix=/usr &&
51 If you want to keep everything after the LFS install seperatate, you can give it
52 the prefix /usr/local. Just make sure you change the ./configure lines to
55 This will compile the Kerberos tools, and a telnetd with kerberos support.
59 see man krb5.conf and man kdc.conf
60 the config files are built much like a windows .ini file. The realm is usually
61 the domain in caps. Below are commands that I used for my configs, only a few
66 cat > /etc/krb5.conf << "EOF"
69 default_realm = NOVASTAR.WOX.ORG
70 default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc
71 default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc
75 kdc = SockPuppet.novastar.wox.org:88
76 admin_server = SockPuppet.novastar.wox.org:749
77 default_domain = novastar.wox.org
81 .novastar.wox.org = NOVASTAR.WOX.ORG
82 novastar.wox.org = NOVASTAR.WOX.ORG
85 kdc = FILE:/var/log/krb5kdc.log
86 admin_server = FILE:/var/log/kadmin.log
87 default = FILE:/var/log/krb5lib.log
90 cat > /etc/kdc.conf << "EOF"
96 database_name = /usr/var/krb5kdc/principal
97 admin_keytab = /usr/var/krb5kdc/kadm5.keytab
98 acl_file = /usr/var/krb5kdc/kadm5.acl
99 dict_file = /usr/var/krb5kdc/kadm5.dict
100 key_stash_file = /usr/var/krb5kdc/.k5.NOVASTAR.WOX.ORG
103 max_renewable_life = 7d 0h 0m 0s
104 master_key_type = des3-hmac-sha1
105 supported_enctypes = des3-hmac-sha1:normal des-cbc-crc:normal
109 To add Kerberos V4 support, add des-cbc-crc:v4 to the supported_enctypes line.
111 add Kerberos to /etc/services with these commandi (note that there daemons can
112 be run an any server within the relm):
114 echo "kerberos 88/udp kdc # Kerberos V5 KDC" >>/etc/services
115 echo "kerberos 88/tcp kdc # Kerberos V5 KDC" >>/etc/services
116 echo "klogin 543/tcp # Kerberos authenticated rlogin"
118 echo "kshell 544/tcp cmd # and remote shell" >>/etc/services
119 echo "kerberos-adm 749/tcp # Kerberos 5 admin/changepw"
121 echo "kerberos-adm 749/udp # Kerberos 5 admin/changepw"
123 echo "krb5_prop 754/tcp # Kerberos slave propagation"
125 echo "eklogin 2105/tcp # Kerberos auth. & encrypted rlogin"
127 echo "krb524 4444/tcp # Kerberos 5 to 4 ticket translator"
130 add Kerberos servers to inetd.conf with these commands. This only allows
131 authentification through kerberos if you want to allow nono kerberos access to
132 telnet (why?) ftp sh etc. have a look at the man pages (make sure you find and
133 remove ftp, telnet, shell, login, and exec from you're config)
135 echo "klogin stream tcp nowait root /usr/sbin/klogind klogind -k -c" >>
137 echo "eklogin stream tcp nowait root /usr/sbin/klogind klogind -k -c -e" >>
139 echo "kshell stream tcp nowait root /usr/sbin/kshd kshd -k -c -A" >>
141 echo "ftp stream tcp nowait root /usr/sbin/ftpd ftpd -a" >>
143 echo "telnet stream tcp nowait root /usr/sbin/telnetd telnetd -a valid" >>
147 Creating the database:
148 the creation of the password database is more complex than I would like to cover
149 in this hint, MIT has a great howto on the entire prosses at
150 http://web.mit.edu/kerberos/www/krb5-1.2/krb5-1.2.2/doc/install.html#SEC42
155 cat > /etc/krb5.conf << "EOF"
157 ticket_lifetime = 600
158 default_realm = NOVASTAR.WOX.ORG
159 default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc
160 default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc
164 kdc = SockPuppet.novastar.wox.org:88
165 admin_server = SockPuppet.novastar.wox.org:749
166 default_domain = novastar.wox.org
170 .novastar.wox.org = NOVASTAR.WOX.ORG
171 novastar.wox.org = NOVASTAR.WOX.ORG
174 add Kerberos to /etc/services with these command:
176 echo "kerberos 88/udp kdc # Kerberos V5 KDC" >>/etc/services
177 echo "kerberos 88/tcp kdc # Kerberos V5 KDC" >>/etc/services
178 echo "klogin 543/tcp # Kerberos authenticated rlogin"
180 echo "kshell 544/tcp cmd # and remote shell" >>/etc/services
181 echo "kerberos-adm 749/tcp # Kerberos 5 admin/changepw"
183 echo "kerberos-adm 749/udp # Kerberos 5 admin/changepw"
185 echo "krb5_prop 754/tcp # Kerberos slave propagation"
187 echo "eklogin 2105/tcp # Kerberos auth. & encrypted rlogin"
189 echo "krb524 4444/tcp # Kerberos 5 to 4 ticket translator"
194 in this section I assume you have openssl installed, if not, go for it. Samba is
195 the only daemon that I have come accross in my search that has kerberos V
196 suport, if you know of any others, let me know.
199 /configure --with-krb5=/usr --with-ssl &&
203 SSH: Unfortanatly OpenSSH (as of now) does not support Kerberos V. NOTE: SSH's
204 support of Kerberos V is EXPERIMENTAL. I take no responsibility if it goes ape
205 and eats you're dog. you have been warned.
206 /configure --with-kerberos5=/usr --prefix=/usr &&
213 this is the final step in our great adventure together. Creating the boot
214 scripts for all of the daemons.
216 cat > /etc/init.d/kdc << "EOF"
218 # Begin /etc/init.d/kdc
221 # Include the functions declared in the /etc/init.d/functions file
224 source /etc/init.d/functions
228 echo -n "Starting Kerberos KDC ..."
233 echo -n "Stopping Kerberos KDC ..."
248 echo "Usage: $0 {start|stop|restart|status}"
254 # End /etc/init.d/kdc
257 cat > /etc/init.d/samba << "EOF"
259 # Begin /etc/init.d/samba
262 # Include the functions declared in the /etc/init.d/functions file
265 source /etc/init.d/functions
269 echo -n "Starting Samba ..."
270 loadproc /usr/local/samba/bin/smbd
274 echo -n "Stopping Samba ..."
289 echo "Usage: $0 {start|stop|restart|status}"
295 # End /etc/init.d/samba
298 cat > /etc/init.d/sshd << "EOF"
300 # Begin /etc/init.d/ssh
303 # Include the functions declared in the /etc/init.d/functions file
306 source /etc/init.d/functions
310 echo -n "Starting SSH ..."
315 echo -n "Stopping SSH ..."
330 echo "Usage: $0 {start|stop|restart|status}"
336 # End /etc/init.d/ssh
339 chmod 754 /etc/init.d/kdc &&
340 chmod 754 /etc/init.d/samba &&
341 chmod 754 /etc/init.d/ssh &&
342 ln -sf ../init.d/kdc /etc/rc0.d/K400kdc &&
343 ln -sf ../init.d/kdc /etc/rc1.d/K400kdc &&
344 ln -sf ../init.d/kdc /etc/rc2.d/K400kdc &&
345 ln -sf ../init.d/kdc /etc/rc3.d/S600kdc &&
346 ln -sf ../init.d/kdc /etc/rc4.d/S600kdc &&
347 ln -sf ../init.d/kdc /etc/rc5.d/S600kdc &&
348 ln -sf ../init.d/kdc /etc/rc6.d/K400kdc &&
349 ln -sf ../init.d/samba /etc/rc0.d/K401samba &&
350 ln -sf ../init.d/samba /etc/rc1.d/K401samba &&
351 ln -sf ../init.d/samba /etc/rc2.d/K401samba &&
352 ln -sf ../init.d/samba /etc/rc3.d/S601samba &&
353 ln -sf ../init.d/samba /etc/rc4.d/S601samba &&
354 ln -sf ../init.d/samba /etc/rc5.d/S601samba &&
355 ln -sf ../init.d/samba /etc/rc6.d/K400samba &&
356 ln -sf ../init.d/ssh /etc/rc0.d/K402ssh &&
357 ln -sf ../init.d/ssh /etc/rc1.d/K402ssh &&
358 ln -sf ../init.d/ssh /etc/rc2.d/K402ssh &&
359 ln -sf ../init.d/ssh /etc/rc3.d/S602ssh &&
360 ln -sf ../init.d/ssh /etc/rc4.d/S602ssh &&
361 ln -sf ../init.d/ssh /etc/rc5.d/S602ssh &&
362 ln -sf ../init.d/ssh /etc/rc6.d/K402ssh
368 Apache hint: http://hints.linuxfromscratch.org/hints/apache+php4+sql.hint.txt
369 Samba hint: http://hints.linuxfromscratch.org/hints/samba.txt
370 MIT's Docs on Kerberos:
371 http://web.mit.edu/kerberos/www/krb5-1.2/index.html#documentation