📄 kerberos5.html
字号:
class="ACRONYM">KDC</acronym> error.</p></li><li><p>With <acronym class="ACRONYM">MIT</acronym> <b class="APPLICATION">Kerberos</b>, ifyou want to allow a principal to have a ticket life longer than the default ten hours,you must use <tt class="COMMAND">modify_principal</tt> in <tt class="COMMAND">kadmin</tt>to change the maxlife of both the principal in question and the <ttclass="USERNAME">krbtgt</tt> principal. Then the principal can use the <varclass="LITERAL">-l</var> option with <tt class="COMMAND">kinit</tt> to request a ticketwith a longer lifetime.</p></li><li><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> If you run a packet sniffer on your <acronymclass="ACRONYM">KDC</acronym> to add in troubleshooting and then run <ttclass="COMMAND">kinit</tt> from a workstation, you will notice that your <acronymclass="ACRONYM">TGT</acronym> is sent immediately upon running <ttclass="COMMAND">kinit</tt> -- even before you type your password! The explanation is thatthe <b class="APPLICATION">Kerberos</b> server freely transmits a <acronymclass="ACRONYM">TGT</acronym> (Ticket Granting Ticket) to any unauthorized request;however, every <acronym class="ACRONYM">TGT</acronym> is encrypted in a key derived fromthe user's password. Therefore, when a user types their password it is not being sent tothe <acronym class="ACRONYM">KDC</acronym>, it is being used to decrypt the <acronymclass="ACRONYM">TGT</acronym> that <tt class="COMMAND">kinit</tt> already obtained. Ifthe decryption process results in a valid ticket with a valid time stamp, the user hasvalid <b class="APPLICATION">Kerberos</b> credentials. These credentials include asession key for establishing secure communications with the <bclass="APPLICATION">Kerberos</b> server in the future, as well as the actualticket-granting ticket, which is actually encrypted with the <bclass="APPLICATION">Kerberos</b> server's own key. This second layer of encryption isunknown to the user, but it is what allows the <b class="APPLICATION">Kerberos</b> serverto verify the authenticity of each <acronym class="ACRONYM">TGT</acronym>.</p></blockquote></div></li><li><p>You have to keep the time in sync between all the computers in your realm. <acronymclass="ACRONYM">NTP</acronym> is perfect for this. For more information on <acronymclass="ACRONYM">NTP</acronym>, see <a href="network-ntp.html">Section 19.12</a>.</p></li><li><p>If you want to use long ticket lifetimes (a week, for example) and you are using <bclass="APPLICATION">OpenSSH</b> to connect to the machine where your ticket is stored,make sure that <b class="APPLICATION">Kerberos</b> <varclass="OPTION">TicketCleanup</var> is set to <var class="LITERAL">no</var> in your <ttclass="FILENAME">sshd_config</tt> or else your tickets will be deleted when you logout.</p></li><li><p>Remember that host principals can have a longer ticket lifetime as well. If your userprincipal has a lifetime of a week but the host you are connecting to has a lifetime ofnine hours, you will have an expired host principal in your cache and the ticket cachewill not work as expected.</p></li><li><p>When setting up a <tt class="FILENAME">krb5.dict</tt> file to prevent specific badpasswords from being used (the manual page for <tt class="COMMAND">kadmind</tt> coversthis briefly), remember that it only applies to principals that have a password policyassigned to them. The <tt class="FILENAME">krb5.dict</tt> files format is simple: onestring per line. Creating a symbolic link to <ttclass="FILENAME">/usr/share/dict/words</tt> might be useful.</p></li></ul></div><div class="SECT2"><h2 class="SECT2"><a id="AEN11922" name="AEN11922">10.7.7. Differences with the <acronymclass="ACRONYM">MIT</acronym> port</a></h2><p>The major difference between the <acronym class="ACRONYM">MIT</acronym> and Heimdalinstalls relates to the <tt class="COMMAND">kadmin</tt> program which has a different(but equivalent) set of commands and uses a different protocol. This has a largeimplications if your <acronym class="ACRONYM">KDC</acronym> is <acronymclass="ACRONYM">MIT</acronym> as you will not be able to use the Heimdal <ttclass="COMMAND">kadmin</tt> program to administer your <acronymclass="ACRONYM">KDC</acronym> remotely (or vice versa, for that matter).</p><p>The client applications may also take slightly different command line options toaccomplish the same tasks. Following the instructions on the <acronymclass="ACRONYM">MIT</acronym> <b class="APPLICATION">Kerberos</b> web site (<ahref="http://web.mit.edu/Kerberos/www/"target="_top">http://web.mit.edu/Kerberos/www/</a>) is recommended. Be careful of pathissues: the <acronym class="ACRONYM">MIT</acronym> port installs into <ttclass="FILENAME">/usr/local/</tt> by default, and the ``normal'' system applications maybe run instead of <acronym class="ACRONYM">MIT</acronym> if your <ttclass="ENVAR">PATH</tt> environment variable lists the system directories first.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> With the <acronym class="ACRONYM">MIT</acronym> <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/security/krb5/pkg-descr"><ttclass="FILENAME">security/krb5</tt></a> port that is provided by FreeBSD, be sure to readthe <tt class="FILENAME">/usr/local/share/doc/krb5/README.FreeBSD</tt> file installed bythe port if you want to understand why logins via <tt class="COMMAND">telnetd</tt> and<tt class="COMMAND">klogind</tt> behave somewhat oddly. Most importantly, correcting the``incorrect permissions on cache file'' behavior requires that the <ttclass="COMMAND">login.krb5</tt> binary be used for authentication so that it can properlychange ownership for the forwarded credentials.</p></blockquote></div></div><div class="SECT2"><h2 class="SECT2"><a id="AEN11950" name="AEN11950">10.7.8. Mitigating limitations foundin <b class="APPLICATION">Kerberos</b></a></h2><div class="SECT3"><h3 class="SECT3"><a id="AEN11956" name="AEN11956">10.7.8.1. <bclass="APPLICATION">Kerberos</b> is an all-or-nothing approach</a></h3><p>Every service enabled on the network must be modified to work with <bclass="APPLICATION">Kerberos</b> (or be otherwise secured against network attacks) orelse the users credentials could be stolen and re-used. An example of this would be <bclass="APPLICATION">Kerberos</b> enabling all remote shells (via <ttclass="COMMAND">rsh</tt> and <tt class="COMMAND">telnet</tt>, for example) but notconverting the <acronym class="ACRONYM">POP3</acronym> mail server which sends passwordsin plaintext.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN11965" name="AEN11965">10.7.8.2. <bclass="APPLICATION">Kerberos</b> is intended for single-user workstations</a></h3><p>In a multi-user environment, <b class="APPLICATION">Kerberos</b> is less secure. Thisis because it stores the tickets in the <tt class="FILENAME">/tmp</tt> directory, whichis readable by all users. If a user is sharing a computer with several other peoplesimultaneously (i.e. multi-user), it is possible that the user's tickets can be stolen(copied) by another user.</p><p>This can be overcome with the <var class="LITERAL">-c</var> filename command-lineoption or (preferably) the <tt class="ENVAR">KRB5CCNAME</tt> environment variable, butthis is rarely done. In principal, storing the ticket in the users home directory andusing simple file permissions can mitigate this problem.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN11974" name="AEN11974">10.7.8.3. The KDC is a single point offailure</a></h3><p>By design, the <acronym class="ACRONYM">KDC</acronym> must be as secure as the masterpassword database is contained on it. The <acronym class="ACRONYM">KDC</acronym> shouldhave absolutely no other services running on it and should be physically secured. Thedanger is high because <b class="APPLICATION">Kerberos</b> stores all passwords encryptedwith the same key (the ``master'' key), which in turn is stored as a file on the <acronymclass="ACRONYM">KDC</acronym>.</p><p>As a side note, a compromised master key is not quite as bad as one might normallyfear. The master key is only used to encrypt the <b class="APPLICATION">Kerberos</b>database and as a seed for the random number generator. As long as access to your<acronym class="ACRONYM">KDC</acronym> is secure, an attacker cannot do much with themaster key.</p><p>Additionally, if the <acronym class="ACRONYM">KDC</acronym> is unavailable (perhapsdue to a denial of service attack or network problems) the network services are unusableas authentication can not be performed, a recipe for a denial-of-service attack. This canalleviated with multiple <acronym class="ACRONYM">KDC</acronym>s (a single master and oneor more slaves) and with careful implementation of secondary or fall-back authentication(<acronym class="ACRONYM">PAM</acronym> is excellent for this).</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN11989" name="AEN11989">10.7.8.4. <bclass="APPLICATION">Kerberos</b> Shortcomings</a></h3><p><b class="APPLICATION">Kerberos</b> allows users, hosts and services to authenticatebetween themselves. It does not have a mechanism to authenticate the <acronymclass="ACRONYM">KDC</acronym> to the users, hosts or services. This means that atrojanned <tt class="COMMAND">kinit</tt> (for example) could record all user names andpasswords. Something like <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/security/tripwire/pkg-descr"><ttclass="FILENAME">security/tripwire</tt></a> or other file system integrity checking toolscan alleviate this.</p></div></div><div class="SECT2"><h2 class="SECT2"><a id="AEN11997" name="AEN11997">10.7.9. Resources and furtherinformation</a></h2><ul><li><p><a href="http://www.faqs.org/faqs/Kerberos-faq/general/preamble.html"target="_top">The <b class="APPLICATION">Kerberos</b> FAQ</a></p></li><li><p><a href="http://web.mit.edu/Kerberos/www/dialogue.html" target="_top">Designing anAuthentication System: a Dialogue in Four Scenes</a></p></li><li><p><a href="http://www.ietf.org/rfc/rfc1510.txt?number=1510" target="_top">RFC 1510, The<b class="APPLICATION">Kerberos</b> Network Authentication Service (V5)</a></p></li><li><p><a href="http://web.mit.edu/Kerberos/www/" target="_top"><acronymclass="ACRONYM">MIT</acronym> <b class="APPLICATION">Kerberos</b> home page</a></p></li><li><p><a href="http://www.pdc.kth.se/heimdal/" target="_top">Heimdal <bclass="APPLICATION">Kerberos</b> home page</a></p></li></ul></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="kerberosiv.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="firewalls.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">KerberosIV</td><td width="34%" align="center" valign="top"><a href="security.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Firewalls</td></tr></table></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -