<?Pub UDT _bookmark _target?><?Pub CX solbook(?><chapter id="user-7"><?Pub Tag atict:info tracking="off" ref="0"?><?Pub Tag atict:user
user="sharonr" fullname="Sharon Veach"?><?Pub Tag atict:user user="kathys"
fullname="Kathy Slattery"?><title>Using Kerberos Applications (Tasks)</title><indexterm><primary>Kerberos</primary><secondary>using</secondary>
</indexterm><highlights><para>This chapter is intended for anyone on a system with the Kerberos service
configured on it. This chapter explains how to use the &ldquo;Kerberized&rdquo;
commands and services that are provided. You should already be familiar with
these commands (in their non-Kerberized versions) before you read about them
here.</para><para>Because this chapter is intended for the general reader, it includes
information on tickets: obtaining, viewing, and destroying them. This chapter
also includes information on choosing or changing a Kerberos password.</para><itemizedlist><para>This is a list of the information in this chapter:</para><listitem><para><olink targetptr="user-8" remap="internal">Kerberos Ticket Management</olink></para>
</listitem><listitem><para><olink targetptr="userspasswd1" remap="internal">Kerberos Password Management</olink></para>
</listitem><listitem><para><olink targetptr="userseamsapp1" remap="internal">Kerberos User Commands</olink></para>
</listitem>
</itemizedlist><para>For an overview of the Solaris Kerberos product, see <olink targetptr="intro-1" remap="internal">Chapter&nbsp;21, Introduction to the Kerberos Service</olink>.</para>
</highlights><sect1 id="user-8"><title>Kerberos Ticket Management</title><para>This section explains how to obtain, view, and destroy tickets. For
an introduction to tickets, see <olink targetptr="intro-25" remap="internal">How the Kerberos
Service Works</olink>.</para><sect2 id="user-19"><title>Do You Need to Worry About Tickets?</title><indexterm><primary>tickets</primary><secondary>obtaining</secondary>
</indexterm><indexterm><primary>tickets</primary><secondary>creating</secondary>
</indexterm><para>With any of the SEAM releases or the Solaris 10 release installed, Kerberos
is built into the <command>login</command> command, and you will obtain tickets
automatically when you log in. The Kerberized commands <command>rsh</command>, <command>rcp</command>, <command>rdist</command>, <command>telnet</command>, and <command>rlogin</command> are usually set up to forward copies of your tickets to the
other machines, so you don't have to explicitly ask for tickets to get access
to those machines. Your configuration might not include this automatic forwarding,
but it is the default behavior. See <olink targetptr="userkerbopts1" remap="internal">Overview
of Kerberized Commands</olink> and <olink targetptr="user-68" remap="internal">Forwarding Kerberos
Tickets</olink> for more information on forwarding tickets.</para><para>For information on ticket lifetimes, see <olink targetptr="refer-502" remap="internal">Ticket
Lifetimes</olink>.</para>
</sect2><sect2 id="user-9"><title>Creating a Kerberos Ticket</title><indexterm><primary>obtaining</primary><secondary>tickets with <command>kinit</command></secondary>
</indexterm><indexterm><primary>creating</primary><secondary>tickets with <command>kinit</command></secondary>
</indexterm><indexterm><primary><command>kinit</command> command</primary><secondary>example</secondary>
</indexterm><indexterm><primary>tickets</primary><secondary>creating with <command>kinit</command></secondary>
</indexterm><para>Normally, if PAM is configured properly, a ticket is created automatically
when you log in, and you need not do anything special to obtain a ticket.
However, you might need to create a ticket if your ticket expires. Also, you
might need to use a different principal besides your default principal, for
example, if you use <command>rlogin</command> <option>l</option> to log in
to a machine as someone else.</para><para>To create a ticket, use the <command>kinit</command> command.</para><screen>% <userinput>/usr/bin/kinit</userinput>
 </screen><para>The <command>kinit</command> command prompts you for your password.
For the full syntax of the <command>kinit</command> command, see the <olink targetdoc="group-refman" targetptr="kinit-1" remap="external"><citerefentry><refentrytitle>kinit</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page. </para><example id="user-21"><title>Creating a Kerberos Ticket</title><para>This example shows a user, <literal>jennifer</literal>, creating a ticket
on her own system.</para><screen>% <userinput>kinit</userinput>
Password for jennifer@ENG.EXAMPLE.COM:  <lineannotation>&lt;Type password&gt;</lineannotation>
 </screen><para>Here, the user <literal>david</literal> creates a ticket that is valid
for three hours with the <option>l</option> option.</para><screen>% <userinput>kinit -l 3h david@EXAMPLE.ORG</userinput>
Password for david@EXAMPLE.ORG:  <lineannotation>&lt;Type password&gt;</lineannotation>
 </screen><para><indexterm><primary>tickets</primary><secondary>forwardable</secondary></indexterm><indexterm><primary>forwardable tickets</primary><secondary>example</secondary></indexterm><indexterm><primary>obtaining</primary><secondary>forwardable tickets</secondary></indexterm><indexterm><primary><command>kinit</command> command</primary><secondary><option>F</option> option</secondary></indexterm>This
example shows the user <literal>david</literal> creating a forwardable ticket
(with the <option>f</option> option) for himself. With this forwardable ticket,
he can, for example, log in to a second system, and then <command>telnet</command> to
a third system.</para><screen>% <userinput>kinit -f david@EXAMPLE.ORG</userinput>
Password for david@EXAMPLE.ORG:     <lineannotation>&lt;Type password&gt;</lineannotation>
 </screen><para>For more information on how forwarding tickets works, see <olink targetptr="user-68" remap="internal">Forwarding Kerberos Tickets</olink> and <olink targetptr="refer-123456" remap="internal">Types of Tickets</olink>.</para>
</example>
</sect2><sect2 id="user-1"><title>Viewing Kerberos Tickets</title><indexterm><primary>viewing</primary><secondary>tickets</secondary>
</indexterm><indexterm><primary>tickets</primary><secondary>viewing</secondary>
</indexterm><indexterm><primary>tickets</primary><secondary><command>klist</command> command</secondary>
</indexterm><indexterm><primary><command>klist</command> command</primary><secondary>example</secondary>
</indexterm><indexterm><primary><command>klist</command> command</primary><secondary><option>f</option> option</secondary>
</indexterm><para>Not all tickets are alike. One ticket might, for example, be <parameter>forwardable</parameter>. Another ticket might be <parameter>postdated</parameter>. While
a third ticket might be both forwardable and postdated. You can see which
tickets you have, and what their attributes are, by using the <command>klist</command> command
with the <option>f</option> option:</para><screen>% <userinput>/usr/bin/klist -f</userinput></screen><para>The following symbols indicate the attributes that are associated with
each ticket, as displayed by <command>klist</command>:</para><variablelist><varlistentry><term>A</term><listitem><para>Preauthenticated</para>
</listitem>
</varlistentry><varlistentry><term>D</term><listitem><para>Postdatable</para>
</listitem>
</varlistentry><varlistentry><term>d</term><listitem><para>Postdated</para>
</listitem>
</varlistentry><varlistentry><term>F</term><listitem><para>Forwardable</para>
</listitem>
</varlistentry><varlistentry><term>f</term><listitem><para>Forwarded</para>
</listitem>
</varlistentry><varlistentry><term>I</term><listitem><para>Initial</para>
</listitem>
</varlistentry><varlistentry><term>i</term><listitem><para>Invalid</para>
</listitem>
</varlistentry><varlistentry><term>P</term><listitem><para>Proxiable</para>
</listitem>
</varlistentry><varlistentry><term>p</term><listitem><para>Proxy</para>
</listitem>
</varlistentry><varlistentry><term>R</term><listitem><para>Renewable</para>
</listitem>
</varlistentry>
</variablelist><para><olink targetptr="refer-123456" remap="internal">Types of Tickets</olink> describes the
various attributes that a ticket can have.</para><example id="user-66"><title>Viewing Kerberos Tickets</title><para>This example shows that the user <literal>jennifer</literal> has an <parameter>initial</parameter> ticket, which is <parameter>forwardable</parameter> (F)
and <parameter>postdated</parameter> (d), but not yet validated (i).</para><screen>% <userinput>/usr/bin/klist -f</userinput>
Ticket cache: /tmp/krb5cc_74287
Default principal: jennifer@ENG.EXAMPLE.COM
 
Valid starting                 Expires                 Service principal
09 Mar 04 15:09:51  09 Mar 04 21:09:51  nfs/EXAMPLE.SUN.COM@EXAMPLE.SUN.COM
        renew until 10 Mar 04 15:12:51, Flags: Fdi
 </screen><para>The following example shows that the user <literal>david</literal> has
two tickets that were <parameter>forwarded</parameter> (f) to his host from
another host. The tickets are also <parameter>forwardable</parameter> (F).</para><screen>% <userinput>klist -f</userinput>
Ticket cache: /tmp/krb5cc_74287
Default principal: david@EXAMPLE.SUN.COM
 
Valid starting                 Expires                 Service principal
07 Mar 04 06:09:51  09 Mar 04 23:33:51  host/EXAMPLE.COM@EXAMPLE.COM
        renew until 10 Mar 04 17:09:51, Flags: fF
 
Valid starting                 Expires                 Service principal
08 Mar 04 08:09:51  09 Mar 04 12:54:51  nfs/EXAMPLE.COM@EXAMPLE.COM
        renew until 10 Mar 04 15:22:51, Flags: fF</screen><para>The following example shows how to display the encryption types of the
session  key and the ticket by using the <option>e</option> option. The <option>a</option> option is used to map the host address to a host name if the name
service can do the conversion.</para><screen>% <userinput>klist -fea</userinput>
Ticket cache: /tmp/krb5cc_74287
Default principal: david@EXAMPLE.SUN.COM
 
Valid starting                 Expires                 Service principal
07 Mar 04 06:09:51  09 Mar 04 23:33:51  krbtgt/EXAMPLE.COM@EXAMPLE.COM
        renew until 10 Mar 04 17:09:51, Flags: FRIA
        Etype(skey, tkt): DES cbc mode with RSA-MD5, DES cbc mode with CRC-32
        Addresses: client.example.com</screen>
</example>
</sect2><sect2 id="user-2"><title>Destroying Kerberos Tickets</title><indexterm><primary>destroying</primary><secondary>tickets with <command>kdestroy</command></secondary>
</indexterm><indexterm><primary>tickets</primary><secondary>destroying</secondary>
</indexterm><indexterm><primary><command>kdestroy</command> command</primary><secondary>example</secondary>
</indexterm><para>If you want to destroy all Kerberos tickets acquired during your current
session, use the <command>kdestroy</command> command. The command destroys
you credential cache, which destroys all your credentials and tickets. While
this is not usually necessary, running <command>kdestroy</command> reduces
the chance of the credential cache being compromised during times that you
are not logged in.</para><para>To destroy your tickets, use the <command>kdestroy</command> command.</para><screen>% <userinput>/usr/bin/kdestroy</userinput></screen><para>The <command>kdestroy</command> command destroys <emphasis>all</emphasis> your
tickets. You cannot use this command to selectively destroy a particular ticket.</para><para>If you are going to be away from your system and are concerned about
an intruder using your permissions, you should use either <command>kdestroy</command> or
a screen saver that locks the screen.</para>
</sect2>
</sect1><sect1 id="userspasswd1"><title>Kerberos Password Management</title><indexterm><primary>Kerberos</primary><secondary>password management</secondary>
</indexterm><indexterm><primary>managing</primary><secondary>passwords with Kerberos</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>managing</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>UNIX and Kerberos</secondary>
</indexterm><para>With the Kerberos service configured, you now have two passwords: your
regular Solaris password and a Kerberos password. You can make both passwords
the same, or they can be different.  </para><sect2 id="userspasswdadvice1"><title>Advice on Choosing a Password</title><indexterm><primary>passwords</primary><secondary>suggestions on choosing</secondary>
</indexterm><indexterm><primary>choosing</primary><secondary>your password</secondary>
</indexterm><itemizedlist><para>Your password can include almost any character that you can type. The
main exceptions are the Control keys and the Return key. A good password is
a password that you can remember readily, but no one else can easily guess.
Examples of bad passwords include the following:</para><listitem><para>Words that can be found in a dictionary</para>
</listitem><listitem><para>Any common or popular name</para>
</listitem><listitem><para>The name of a famous person or character</para>
</listitem><listitem><para>Your name or user name in any form (for example: your name
spelled backward, repeated twice, and so forth)</para>
</listitem><listitem><para>A spouse's name, child's name, or pet's name</para>
</listitem><listitem><para>Your birth date or a relative's birth date</para>
</listitem><listitem><para>Your social security number, driver's license number, passport
number, or other similar identifying number</para>
</listitem><listitem><para>Any sample password that appears in this manual or any other
manual</para>
</listitem>
</itemizedlist><itemizedlist><para>A good password is at least eight characters long. Moreover, a password
should include a mix of characters, such as uppercase and lowercase letters,
numbers, and punctuation marks. Examples of passwords that would be good if
they didn't appear in this manual include the following:  </para><listitem><para>Acronyms, such as &ldquo;I2LMHinSF&rdquo; (which is recalled
as &ldquo;I too left my heart in San Francisco&rdquo;) </para>
</listitem><listitem><para>Easy-to-pronounce nonsense words, such as &ldquo;WumpaBun&rdquo;
or &ldquo;WangDangdoodle!&rdquo;</para>
</listitem><listitem><para>Deliberately misspelled phrases, such as &ldquo;6o'cluck&rdquo;
or &ldquo;RrriotGrrrlsRrrule!&rdquo;</para>
</listitem>
</itemizedlist><caution><para>Don't use these examples. Passwords that appear in manuals
are the first passwords that an intruder will try. </para>
</caution>
</sect2><sect2 id="userschangepasswd1"><title>Changing Your Password</title><itemizedlist><para>If PAM is properly configured, you can change your Kerberos password
in two ways:</para><listitem><para><indexterm><primary>changing</primary><secondary>your password with <command>passwd</command></secondary></indexterm><indexterm><primary>passwords</primary><secondary>changing with <command>passwd</command> command</secondary></indexterm><indexterm><primary><command>passwd</command> command</primary><secondary>and <command>kpasswd</command> command</secondary></indexterm>With
the usual UNIX <command>passwd</command> command. With the Kerberos service
configured, the Solaris <command>passwd</command> command also automatically
prompts for a new Kerberos password.</para><para>The advantage of using <command>passwd</command> instead of <command>kpasswd</command> is that you can set
both UNIX and Kerberos passwords at the same time. However, you generally
do not <emphasis>have</emphasis> to change both passwords with <command>passwd</command>.
Often, you can change only your UNIX password and leave the Kerberos password
untouched, or vice-versa.</para><note><para>The behavior of <command>passwd</command> depends on how the PAM
module is configured. You might be required to change both passwords in some
configurations. For some sites, the UNIX password must be changed, while other
sites require the Kerberos password to change.</para>
</note>
</listitem><listitem><para><indexterm><primary>changing</primary><secondary>your password with <command>kpasswd</command></secondary></indexterm><indexterm><primary>passwords</primary><secondary>changing with <command>kpasswd</command> command</secondary></indexterm><indexterm><primary><command>kpasswd</command> command</primary><secondary><command>passwd</command> command and</secondary></indexterm>With
the <command>kpasswd</command> command. <command>kpasswd</command> is very
similar to <command>passwd</command>. One difference is that <command>kpasswd</command> changes
only Kerberos passwords. You must use <command>passwd</command> if you want
to change your UNIX password. </para><para>Another difference is that <command>kpasswd</command> can change a password for a Kerberos principal that is not a valid
UNIX user. For example, <literal>david/admin</literal> is a Kerberos principal,
but not an actual UNIX user, so you must use <command>kpasswd</command> instead
of <command>passwd</command>.</para>
</listitem>
</itemizedlist><para>After you change your password, it takes some time for the change to
propagate through a system (especially over a large network). Depending on
how your system is set up, this delay might take anywhere from a few minutes
to an hour or more. If you need to get new Kerberos tickets shortly after
you change your password, try the new password first. If the new password
doesn't work, try again using the old password.   </para><para><indexterm><primary>policies</primary><secondary>passwords and</secondary></indexterm><indexterm><primary>passwords</primary><secondary> policies and</secondary></indexterm>Kerberos V5 protocol enables system administrators to set criteria
about allowable passwords for each user. Such criteria is defined by the <emphasis>policy</emphasis> set for each user (or by a default policy). See <olink targetptr="aadmin-68" remap="internal">Administering Kerberos Policies</olink> for more on
policies.</para><para><indexterm><primary><command>kpasswd</command> command</primary><secondary>error message</secondary></indexterm><indexterm><primary>error messages</primary><secondary>with <command>kpasswd</command></secondary></indexterm>For example, suppose that user <literal>jennifer</literal>'s policy
(call it <literal>jenpol</literal>) mandates that passwords be at least eight
letters long and include a mix of at least two types of characters. <command>kpasswd</command> will therefore reject an attempt to use &ldquo;sloth&rdquo; as
a password.</para><screen>% <userinput>kpasswd</userinput>
kpasswd: Changing password for jennifer@ENG.EXAMPLE.COM.
Old password:   <lineannotation>&lt;Jennifer types her existing password&gt;</lineannotation>
kpasswd: jennifer@ENG.EXAMPLE.COM's password is controlled by
the policy jenpol
which requires a minimum of 8 characters from at least 2 classes 
(the five classes are lowercase, uppercase, numbers, punctuation,
and all other characters).
New password: <lineannotation>&lt;Jennifer types  'sloth'&gt;</lineannotation>
New password (again):  <lineannotation>&lt;Jennifer re-types 'sloth'&gt;</lineannotation>
kpasswd: New password is too short.
Please choose a password which is at least 4 characters long.</screen><para>Here, <literal>jennifer</literal> uses &ldquo;slothrop49&rdquo; as a
password. &ldquo;slothrop49&rdquo; meets the criteria, because it is over
eight letters long and contains two different types of characters (numbers
and lowercase letters).</para><screen>% <userinput>kpasswd</userinput>
kpasswd: Changing password for jennifer@ENG.EXAMPLE.COM.
Old password:  <lineannotation>&lt;Jennifer types her existing password&gt;</lineannotation>
kpasswd: jennifer@ENG.EXAMPLE.COM's password is controlled by
the policy jenpol
which requires a minimum of 8 characters from at least 2 classes 
(the five classes are lowercase, uppercase, numbers, punctuation,
and all other characters).
New password:  <lineannotation>&lt;Jennifer types  'slothrop49'&gt;</lineannotation>
New password (again):  <lineannotation>&lt;Jennifer re-types 'slothrop49'&gt;</lineannotation>
Kerberos password changed.</screen><example id="user-67"><title>Changing Your Password</title><para>In the following example, user <literal>david</literal> changes both
his UNIX password and Kerberos password with <command>passwd</command>. </para><screen>% <userinput>passwd</userinput>
	passwd:  Changing password for david
	Enter login (NIS+) password:         <lineannotation>&lt;Type the current UNIX password&gt;</lineannotation>
	New password:                        <lineannotation>&lt;Type the new UNIX password&gt;</lineannotation>
	Re-enter password:                   <lineannotation>&lt;Confirm the new UNIX password&gt;</lineannotation>
	Old KRB5 password:                   <lineannotation>&lt;Type the current Kerberos password&gt;</lineannotation>
	New KRB5 password:                   <lineannotation>&lt;Type the new Kerberos password&gt;</lineannotation>
	Re-enter new KRB5 password:          <lineannotation>&lt;Confirm the new Kerberos password&gt;</lineannotation></screen><para>Note that <command>passwd</command> asks for both the UNIX password
and the Kerberos password. This behavior is established by the default configuration.
In that case, user <literal>david</literal> must use <command>kpasswd</command> to
set his Kerberos password to something else, as shown next.</para><para><indexterm><primary><command>kpasswd</command> command</primary><secondary>example</secondary></indexterm>This example shows user <literal>david</literal> changing
only his Kerberos password with <command>kpasswd</command>.</para><screen>% <userinput>kpasswd</userinput>
kpasswd: Changing password for david@ENG.EXAMPLE.COM.
Old password:           <lineannotation>&lt;Type the current Kerberos password&gt;</lineannotation>
New password:           <lineannotation>&lt;Type the new Kerberos password&gt;</lineannotation>
New password (again):   <lineannotation>&lt;Confirm the new Kerberos password&gt;</lineannotation>
Kerberos password changed.
 </screen><para>In this example, user <literal>david</literal> changes the password
for the Kerberos principal <literal>david/admin</literal> (which is not a
valid UNIX user). He must use <command>kpasswd</command>.</para><screen>% <userinput>kpasswd david/admin</userinput>
kpasswd:  Changing password for david/admin.
Old password:           <lineannotation>&lt;Type the current Kerberos password&gt;</lineannotation>
New password:           <lineannotation>&lt;Type the new Kerberos password&gt;</lineannotation>
New password (again):   <lineannotation>&lt;Type the new Kerberos password&gt;</lineannotation>
Kerberos password changed. 
 </screen>
</example>
</sect2><sect2 id="userk5login1"><title>Granting Access to Your Account</title><indexterm><primary><filename>.k5login</filename> file</primary><secondary>description</secondary>
</indexterm><indexterm><primary>granting access to your account</primary>
</indexterm><indexterm><primary>access</primary><secondary>granting to your account</secondary>
</indexterm><indexterm><primary>access</primary><secondary>granting to your account</secondary>
</indexterm><indexterm><primary>granting access to your account</primary>
</indexterm><indexterm><primary>Kerberos</primary><secondary>granting access to your account</secondary>
</indexterm><indexterm><primary>passwords</primary><secondary>granting access without revealing</secondary>
</indexterm><para>If you need to give someone access to log in to your account (as you),
you can do so through Kerberos, without revealing your password, by putting
a <filename>.k5login</filename> file in your home directory. A <filename>.k5login</filename> file is a list of one or more Kerberos principals corresponding
to each person for whom you want to grant access. Each principal must be on
a separate line.</para><para>Suppose that the user <literal>david</literal> keeps a <filename>.k5login</filename> file
in his home directory that looks like the following:</para><screen>jennifer@ENG.EXAMPLE.COM
joe@EXAMPLE.ORG  </screen><para>This file allows the users <literal>jennifer</literal> and <literal>joe</literal> to
assume <literal>david</literal>'s identity, provided that they already have
Kerberos tickets in their respective realms. For example, jennifer can remotely
log in to <literal>david</literal>'s machine (<literal>boston</literal>),
as him, without having to give his password.</para><figure id="user-fig-39"><title>Using the <filename>.k5login</filename> File
to Grant Access to Your Account</title><mediaobject><imageobject><imagedata entityref="K5login"/>
</imageobject><textobject><simpara>The preceding context describes the graphic.</simpara>
</textobject>
</mediaobject>
</figure><para>In the case where <literal>david</literal>'s home directory is NFS-mounted,
using Kerberos V5 protocols, from another (third) machine, <literal>jennifer</literal> must
have a forwardable ticket in order to access his home directory. See <olink targetptr="user-9" remap="internal">Creating a Kerberos Ticket</olink> for an example of using
a forwardable ticket.</para><para>If you will be logging in to other machines across a network, you'll
want to include your own Kerberos principal in <filename>.k5login</filename> files
on those machines. </para><itemizedlist><para><indexterm><primary><filename>.k5login</filename> file</primary><secondary>rather than revealing password</secondary></indexterm>Using a <filename>.k5login</filename> file is much safer than giving out your password for these
reasons:</para><listitem><para>You can take access away any time by removing the principal
from your <filename>.k5login</filename> file.</para>
</listitem><listitem><para>Although users principals named in the <filename>.k5login</filename> file
in your home directory have full access to your account on that machine (or
sets of machines, if the <filename>.k5login</filename> file is shared, for
example, over NFS). However, any Kerberized services will authorize access
based on that user's identity, not yours. So <literal>jennifer</literal> can
log in to <literal>joe</literal>'s machine and perform tasks there. However,
if she uses a Kerberized program such as <command>ftp</command> or <command>rlogin</command>, she does so as herself.</para>
</listitem><listitem><para>Kerberos keeps a log of who obtains tickets, so a system administrator
can find out, if necessary, who is capable of using your user identity at
a particular time.</para>
</listitem>
</itemizedlist><para>One common way to use the <filename>.k5login</filename> file is to put
it in <literal>root</literal>'s home directory, giving <literal>root</literal> access
for that machine to the Kerberos principals listed. This configuration allows
system administrators to become <literal>root</literal> locally, or to log
in remotely as <literal>root</literal>, without having to give out the <literal>root</literal> password, and without requiring anyone to type the <literal>root</literal> password
over the network.</para><example id="user-49"><title>Using the <filename>.k5login</filename> File
to Grant Access to Your Account</title><para>Suppose <literal>jennifer</literal> decides to log in to the machine <literal>boston.example.com</literal> as <literal>root</literal>. Because she has an
entry for her principal name in the <filename>.k5login</filename> file in <literal>root</literal>'s home directory on <literal>boston.example.com</literal>,
she again does not have to type in her password.</para><screen>% <userinput>rlogin boston.example.com -l root -x</userinput>
This rlogin session is using DES encryption for all data transmissions.
Last login: Thu Jun 20 16:20:50 from daffodil
SunOS Release 5.7 (GENERIC) #2: Tue Nov 14 18:09:31 EST 1998
boston[root]% </screen>
</example>
</sect2>
</sect1><sect1 id="userseamsapp1"><title>Kerberos User Commands</title><indexterm><primary>Kerberos</primary><secondary>commands</secondary>
</indexterm><indexterm><primary>Kerberos commands</primary>
</indexterm><indexterm><primary>single-sign-on system</primary>
</indexterm><para>Kerberos V5 product is a <emphasis>single-sign-on</emphasis> system,
which means that you only have to type your password once. The Kerberos V5
programs do the authenticating (and optional encrypting) for you, because
Kerberos has been built into each of a suite of existing, familiar network
programs.  The Kerberos V5 applications are versions of existing UNIX network
programs with Kerberos features added.</para><para>For example, when you use a Kerberized program to connect to a remote
host, the program, the KDC, and the remote host perform a set of rapid negotiations.
When these negotiations are completed, your program has proven your identity
on your behalf to the remote host, and the remote host has granted you access.</para><para>Note that Kerberized commands try to authenticate with Kerberos first.
If Kerberos authentication fails, an error occurs or UNIX authentication is
attempted, depending on what options were used with the command. Refer to
the <literal>Kerberos Security</literal> section in each Kerberos command
man page for more detailed information.</para><sect2 id="userkerbopts1"><title>Overview of Kerberized Commands</title><indexterm><primary>Kerberos</primary><secondary>overview</secondary><tertiary>Kerberized commands</tertiary>
</indexterm><indexterm><primary><command>ftp</command> command</primary><secondary>Kerberos and</secondary>
</indexterm><indexterm><primary><command>rcp</command> command</primary><secondary>Kerberos and</secondary>
</indexterm><indexterm><primary><command>rlogin</command> command</primary><secondary>Kerberos and</secondary>
</indexterm><indexterm><primary><command>rsh</command> command</primary><secondary>Kerberos and</secondary>
</indexterm><indexterm><primary><command>telnet</command> command</primary><secondary>Kerberos and</secondary>
</indexterm><itemizedlist><para>The Kerberized network services are programs that connect to another
machine somewhere on the Internet. These programs are the following: </para><listitem><para><command>ftp</command></para>
</listitem><listitem><para><command>rcp</command></para>
</listitem><listitem><para><command>rdist</command></para>
</listitem><listitem><para><command>rlogin</command></para>
</listitem><listitem><para><command>rsh</command></para>
</listitem><listitem><para><command>ssh</command></para>
</listitem><listitem><para><command>telnet</command></para>
</listitem>
</itemizedlist><para>These programs have features that transparently use your Kerberos tickets
for negotiating authentication and optional encryption with the remote host.
In most cases, you'll notice only that you no longer have to type your password
to use them, because Kerberos will provide proof of your identity for you.</para><itemizedlist><para>The Kerberos V5 network programs include options that enable you to
do the following:</para><listitem><para>Forward your tickets to the another host (if you initially
obtained forwardable tickets).</para>
</listitem><listitem><para>Encrypt data transmitted between you and the remote host.</para>
</listitem>
</itemizedlist><note><para>This section assumes you are already familiar with the non-Kerberos
versions of these programs, and highlights the Kerberos functionality added
by the Kerberos V5 package. For detailed descriptions of the commands described
here, see their respective man pages.</para>
</note><para><indexterm><primary>Kerberos</primary><secondary>options to Kerberized commands</secondary></indexterm><indexterm><primary>options to Kerberized commands</primary></indexterm>The following Kerberos options have been added
to <command>ftp</command>, <command>rcp</command>, <command>rlogin</command>, <command>rsh</command>, and <command>telnet</command>:</para><variablelist><varlistentry><term><option>a</option></term><listitem><para><indexterm><primary><option>a</option> option</primary><secondary>Kerberized commands</secondary></indexterm><indexterm><primary>automatic login</primary><secondary>enabling</secondary></indexterm>Attempts automatic
login using your existing tickets. Uses the username as returned by <function>getlogin</function>, unless the name is different from the current user ID. See the <citerefentry><refentrytitle>telnet</refentrytitle><manvolnum>1</manvolnum></citerefentry> man
page for details.</para>
</listitem>
</varlistentry><varlistentry><term><option>f</option></term><listitem><para><indexterm><primary sortas="f1"><option>f</option> option</primary><secondary>Kerberized commands</secondary></indexterm><indexterm><primary>forwardable tickets</primary><secondary>with <option>f</option> option</secondary></indexterm>Forwards a <emphasis>non-reforwardable</emphasis> ticket to a
remote host. This option is mutually exclusive with the <option>F</option> option.
They cannot be used together in the same command.</para><para>You'll want to forward a ticket if you have reason to believe you'll
need to authenticate yourself to other Kerberos-based services on a third
host. For example, you might want to remotely log in to another machine and
then remotely log in from it to a third machine.</para><para>You should definitely use a forwardable ticket if your home directory
on the remote host is NFS-mounted using the Kerberos V5 mechanism. Otherwise,
you won't be able to access your home directory. That is, suppose you initially
log in to System 1. From System 1, you remotely log in to your home machine,
System 2, which mounts your home directory from System 3. Unless you've used
the <option>f</option> or <option>F</option> option with <command>rlogin</command>,
you won't be able to get to your home directory because your ticket can't
be forwarded to System 3.</para><para>By default, <command>kinit</command> obtains forwardable ticket-granting
tickets (TGTs). However, your configuration might differ in this respect.</para><para>For more information on forwarding tickets, see <olink targetptr="user-68" remap="internal">Forwarding Kerberos Tickets</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><option>F</option></term><listitem><para><indexterm><primary sortas="f2"><option>F</option> option</primary><secondary>Kerberized commands</secondary></indexterm><indexterm><primary>forwardable tickets</primary><secondary>with <option>F</option> option</secondary></indexterm><indexterm><primary>tickets</primary><secondary><option>F</option> option or <option>f</option> option</secondary></indexterm>Forwards a <emphasis>reforwardable</emphasis> copy of your TGT to a remote system. It is similar to <option>f</option>,
but it allows for access to a further (say, fourth or fifth) machine. The <option>F</option> option can therefore be regarded as being a superset of the <option>f</option> option.
The <option>F</option> option is mutually exclusive with the <option>f</option> option.
They cannot be used together in the same command.</para><para>For more information on forwarding tickets, see <olink targetptr="user-68" remap="internal">Forwarding Kerberos Tickets</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><option>k</option> <replaceable>realm</replaceable></term><listitem><para><indexterm><primary>realms (Kerberos)</primary><secondary>requesting tickets for specific</secondary></indexterm><indexterm><primary>tickets</primary><secondary>requesting for specific realm</secondary></indexterm><indexterm><primary sortas="k1"><option>k</option> option</primary><secondary>Kerberized commands</secondary></indexterm><indexterm><primary>tickets</primary><secondary><option>k</option> option</secondary></indexterm>Requests tickets for the remote host
in the specified <replaceable>realm</replaceable>, instead of determining
the realm itself using the <filename>krb5.conf</filename> file.</para>
</listitem>
</varlistentry><varlistentry><term><option>K</option></term><listitem><para><indexterm><primary sortas="k2"><option>K</option> option</primary><secondary>Kerberized commands</secondary></indexterm><indexterm><primary>automatic login</primary><secondary>disabling</secondary></indexterm>Uses your tickets
to authenticate to the remote host, but does not automatically log in.</para>
</listitem>
</varlistentry><varlistentry><term><option>m</option> <replaceable>mechanism</replaceable></term><listitem><para><indexterm><primary><option>m</option> option</primary><secondary>Kerberized commands</secondary></indexterm><indexterm><primary>security mechanism</primary><secondary>specifying with <option>m</option> option</secondary></indexterm>Specifies the GSS-API security mechanism to use, as listed in
the <filename>/etc/gss/mech</filename> file. Defaults to <literal>kerberos_v5</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><option>x</option></term><listitem><para><indexterm><primary><option>x</option> option</primary><secondary>Kerberized commands</secondary></indexterm><indexterm><primary>encryption</primary><secondary>with <option>x</option> option</secondary></indexterm>Encrypts
this session.</para>
</listitem>
</varlistentry><varlistentry><term><option>X</option> <replaceable>auth-type</replaceable></term><listitem><para><indexterm><primary>authentication</primary><secondary>disabling with <option>X</option> option</secondary></indexterm><indexterm><primary sortas="x option1"><option>X</option> option</primary><secondary>Kerberized commands</secondary></indexterm>Disables the <replaceable>auth-type</replaceable> type
of authentication.</para>
</listitem>
</varlistentry>
</variablelist><para><indexterm><primary>Kerberos</primary><secondary>table of network command options</secondary></indexterm>The following table shows which commands have
specific options. An &ldquo;X&rdquo; indicates that the command has that option.</para><table frame="topbot" pgwide="0" id="userkerboptstable1"><title>Kerberos Options
for Network Commands</title><tgroup cols="6" colsep="0" rowsep="0"><colspec colwidth="70*"/><colspec colwidth="65*" align="center"/><colspec colwidth="65*" align="center"/><colspec colwidth="65*" align="center"/><colspec colwidth="65*" align="center"/><colspec colwidth="66*" align="center"/><thead><row rowsep="1"><entry><para></para>
</entry><entry><para><command>ftp</command></para>
</entry><entry><para><command>rcp</command></para>
</entry><entry><para><command>rlogin</command></para>
</entry><entry><para><command>rsh</command></para>
</entry><entry><para><command>telnet</command></para>
</entry>
</row>
</thead><tbody><row><entry><para><option>a</option></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para>X</para>
</entry>
</row><row><entry><para><option>f</option></para>
</entry><entry><para>X</para>
</entry><entry><para></para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry>
</row><row><entry><para><option>F</option></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry>
</row><row><entry><para><option>k</option></para>
</entry><entry><para></para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry>
</row><row><entry><para><option>K</option></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para>X</para>
</entry>
</row><row><entry><para><option>m</option></para>
</entry><entry><para>X</para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><option>x</option></para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry><entry><para>X</para>
</entry>
</row><row><entry><para><option>X</option></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para></para>
</entry><entry><para>X</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para><indexterm><primary><command>ftp</command> command</primary><secondary>setting protection level in</secondary></indexterm><indexterm><primary>protection level</primary><secondary>setting in <command>ftp</command></secondary></indexterm>Additionally, <command>ftp</command> allows the protection level
for a session to be set at its prompt:</para><variablelist><varlistentry><term>clear</term><listitem><para><indexterm><primary>clear protection level</primary></indexterm><indexterm><primary>protection level</primary><secondary>clear</secondary></indexterm>Sets
the protection level to &ldquo;clear&rdquo; (no protection). This protection
level is the default.</para>
</listitem>
</varlistentry><varlistentry><term>private</term><listitem><para><indexterm><primary>private protection level</primary></indexterm><indexterm><primary>protection level</primary><secondary>private</secondary></indexterm><indexterm><primary>privacy</primary><secondary>availability</secondary></indexterm>Sets the protection level to &ldquo;private.&rdquo; Data transmissions
are confidentiality-protected and integrity-protected by encryption. The privacy
service might not be available to all Kerberos users, however.</para>
</listitem>
</varlistentry><varlistentry><term>safe</term><listitem><para><indexterm><primary>safe protection level</primary></indexterm><indexterm><primary>protection level</primary><secondary>safe</secondary></indexterm>Sets
the protection level to &ldquo;safe.&rdquo; Data transmissions are integrity-protected
by cryptographic checksum.</para>
</listitem>
</varlistentry>
</variablelist><para>You can also set the protection level at the <command>ftp</command> prompt
by typing <literal>protect</literal> followed by any of the protection levels
shown above (<literal>clear</literal>, <literal>private</literal>, or <literal>safe</literal>).</para>
</sect2><sect2 id="user-68"><title>Forwarding Kerberos Tickets</title><indexterm><primary sortas="f2"><option>F</option> option</primary><secondary>Kerberized commands</secondary>
</indexterm><indexterm><primary>tickets</primary><secondary>forwardable</secondary>
</indexterm><indexterm><primary>forwardable tickets</primary><secondary>with <option>F</option> option</secondary>
</indexterm><indexterm><primary sortas="f1"><option>f</option> option</primary><secondary>Kerberized commands</secondary>
</indexterm><indexterm><primary>forwardable tickets</primary><secondary>with <option>f</option> option</secondary>
</indexterm><para>As described in <olink targetptr="userkerbopts1" remap="internal">Overview of Kerberized
Commands</olink>, some commands allow you to forward tickets with either the <option>f</option> or <option>F</option> option. Forwarding tickets allows you to &ldquo;chain&rdquo;
your network transactions. You can, for example, remotely log in to one machine
and then remotely log in from it to another machine. The <option>f</option> option
allows you to forward a ticket, while the <option>F</option> option allows
you to reforward a forwarded ticket.</para><para>In <olink targetptr="user-fig-70" remap="internal">Figure&nbsp;26&ndash;2</olink>, the user <literal>david</literal> obtains a non-forwardable ticket-granting ticket (TGT) with <command>kinit</command>. The ticket is non-forwardable because he did not specify
the <option>f</option> option. In scenario 1, he is able to remotely log in
to machine B, but he can go no further. In scenario 2, the <command>rlogin</command> <option>f</option> command fails because he is attempting to forward a ticket that
is non-forwardable.</para><figure id="user-fig-70"><title>Using Non-Forwardable Tickets</title><mediaobject><imageobject><imagedata entityref="Kinit"/>
</imageobject><textobject><simpara>The preceding context describes the graphic.</simpara>
</textobject>
</mediaobject>
</figure><para>In actuality, Kerberos configuration files are set up so that <command>kinit</command> obtains forwardable tickets by default. However, your configuration
might differ. For the sake of explanation, assume that <command>kinit</command> does <emphasis>not</emphasis> obtain forwardable TGTs unless it is invoked with <command>kinit</command> <option>f</option>. Notice, by the way, that <command>kinit</command> does not have
a <option>F</option> option. TGTs are either forwardable or not.</para><para>In <olink targetptr="user-fig-69" remap="internal">Figure&nbsp;26&ndash;3</olink>, the user <literal>david</literal> obtains forwardable TGTs with <command>kinit</command> <option>f</option>.
In scenario 3, he is able to reach machine C because he uses a forwardable
ticket with <command>rlogin</command>. In scenario 4, the second <command>rlogin</command> fails
because the ticket is not reforwardable. By using the <option>F</option> option
instead, as in scenario 5, the second <command>rlogin</command> succeeds and
the ticket can be reforwarded on to machine D.</para><figure id="user-fig-69"><title>Using Forwardable Tickets</title><mediaobject><imageobject><imagedata entityref="KinitDashEff"/>
</imageobject><textobject><simpara>The preceding context describes the graphic.</simpara>
</textobject>
</mediaobject>
</figure>
</sect2><sect2 id="useroptexamples1"><title>Using Kerberized Commands (Examples)</title><indexterm><primary>Kerberos</primary><secondary>examples of using Kerberized commands</secondary>
</indexterm><indexterm><primary>Kerberos commands</primary><secondary>examples</secondary>
</indexterm><para>The following examples show how the options to the Kerberized commands
work.</para><example id="user-52"><title>Using the <option>a</option>, <option>f</option>,
and <option>x</option> Options With <command>telnet</command></title><para>In this example, the user <literal>david</literal> has already logged
in, and wants to <command>telnet</command> to the machine <literal>denver.example.com</literal>. He uses the <option>f</option> option to forward his existing
tickets, the <option>x</option> option to encrypt the session, and the <option>a</option> option
to perform the login automatically. Because he does not plan to use the services
of a third host, he can use <option>f</option> instead of <option>F</option>.</para><screen>% <userinput>telnet -a -f -x denver.example.com</userinput> 
Trying 128.0.0.5... 
Connected to denver.example.com. Escape character is '^]'. 
[ Kerberos V5 accepts you as "david@eng.example.com" ] 
[ Kerberos V5 accepted forwarded credentials ] 
SunOS 5.9: Tue May 21 00:31:42 EDT 2004  Welcome to SunOS 
%</screen><para>Notice that <literal>david</literal>'s machine used Kerberos to authenticate
him to <literal>denver.example.com</literal>, and logged him in automatically
as himself. He had an encrypted session, a copy of his tickets already waiting
for him, and he never had to type his password. If he had used a non-Kerberos
version of <command>telnet</command>, he would have been prompted for his
password, and it would have been sent over the network unencrypted. If an
intruder had been watching network traffic at the time, the intruder would
have known <literal>david</literal>'s password.</para><para>If you forward your Kerberos tickets, <command>telnet</command> (as
well as the other commands discussed here) destroys them when it exits.</para>
</example><example id="user-50"><title>Using <command>rlogin</command> With the <option>F</option> Option</title><para>Here, the user <literal>jennifer</literal> wants to log in to her own
machine, <literal>boston.example.com</literal>. She forwards her existing
tickets with the <option>F</option> option, and encrypts the session with
the <option>x</option> option. She chooses <option>F</option> rather than <option>f</option> because after she is logged in to <literal>boston</literal>, she
might want to perform other network transactions requiring tickets to be reforwarded.
Also, because she is forwarding her existing tickets, she does not have to
type her password.</para><screen>% <userinput>rlogin boston.example.com -F -x</userinput>
This rlogin session is using encryption for all transmissions.
Last login Mon May 19 15:19:49 from daffodil 
SunOS Release 5.9 (GENERIC) #2 Tue Nov 14 18:09:3 EST 2003 
%</screen>
</example><example id="user-46"><title>Setting the Protection Level in <command>ftp</command></title><para>Suppose that <literal>joe</literal> wants to use <command>ftp</command> to
get his mail from the directory <literal>~joe/MAIL</literal> from the machine <literal>denver.example.com</literal>, encrypting the session. The exchange would look
like the following:</para><screen>% <userinput>ftp -f denver.example.com</userinput>
Connected to denver.example.com
220 denver.example.org FTP server (Version 6.0) ready.
334 Using authentication type GSSAPI; ADAT must follow
GSSAPI accepted as authentication type 
GSSAPI authentication succeeded Name (daffodil.example.org:joe) 
232 GSSAPI user joe@MELPOMENE.EXAMPLE.COM is authorized as joe
230 User joe logged in.
Remote system type is UNIX.
Using BINARY mode to transfer files.
ftp&gt; <userinput>protect private</userinput>
200 Protection level set to Private
ftp&gt; <userinput>cd ~joe/MAIL</userinput>
250 CWD command successful.
ftp&gt; <userinput>get RMAIL</userinput>
227 Entering Passive Mode (128,0,0,5,16,49)
150 Opening BINARY mode data connection for RMAIL (158336 bytes).
226 Transfer complete. 158336 bytes received in 1.9 seconds (1.4e+02 Kbytes/s)
ftp&gt; <userinput>quit</userinput>
% </screen><para>To encrypt the session, <literal>joe</literal> sets the protection level
to <literal>private</literal>. </para>
</example>
</sect2>
</sect1>
</chapter><?Pub *0000050235 0?>