1.\"	$NetBSD: ktutil.8,v 1.4 2014/04/25 00:26:16 pettai Exp $
2.\"
3.\" Copyright (c) 1997-2004 Kungliga Tekniska Högskolan
4.\" (Royal Institute of Technology, Stockholm, Sweden).
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" 3. Neither the name of the Institute nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\" Id
35.\"
36.Dd April 14, 2005
37.Dt KTUTIL 8
38.Os
39.Sh NAME
40.Nm ktutil
41.Nd manage Kerberos keytabs
42.Sh SYNOPSIS
43.Nm
44.Oo Fl k Ar keytab \*(Ba Xo
45.Fl Fl keytab= Ns Ar keytab
46.Xc
47.Oc
48.Op Fl v | Fl Fl verbose
49.Op Fl Fl version
50.Op Fl h | Fl Fl help
51.Ar command
52.Op Ar args
53.Sh DESCRIPTION
54.Nm
55is a program for managing keytabs.
56Supported options:
57.Bl -tag -width Ds
58.It Fl v , Fl Fl verbose
59Verbose output.
60.El
61.Pp
62.Ar command
63can be one of the following:
64.Bl -tag -width srvconvert
65.It add Oo Fl p Ar principal Oc Oo Fl Fl principal= Ns Ar principal Oc \
66Oo Fl V Ar kvno Oc Oo Fl Fl kvno= Ns Ar kvno Oc Oo Fl e Ar enctype Oc \
67Oo Fl Fl enctype= Ns Ar enctype Oc Oo Fl w Ar password Oc \
68Oo Fl Fl password= Ns Ar password Oc Oo Fl r Oc Oo Fl Fl random Oc \
69Oo Fl s Oc Oo Fl Fl no-salt Oc Oo Fl H Oc Op Fl Fl hex
70Adds a key to the keytab. Options that are not specified will be
71prompted for. This requires that you know the password or the hex key of the
72principal to add; if what you really want is to add a new principal to
73the keytab, you should consider the
74.Ar get
75command, which talks to the kadmin server.
76.It change Oo Fl r Ar realm Oc Oo Fl Fl realm= Ns Ar realm Oc \
77Oo Fl Fl a Ar host Oc Oo Fl Fl admin-server= Ns Ar host Oc \
78Oo Fl Fl s Ar port Oc Op Fl Fl server-port= Ns Ar port
79Update one or several keys to new versions.  By default, use the admin
80server for the realm of a keytab entry.  Otherwise it will use the
81values specified by the options.
82.Pp
83If no principals are given, all the ones in the keytab are updated.
84.It copy Ar keytab-src Ar keytab-dest
85Copies all the entries from
86.Ar keytab-src
87to
88.Ar keytab-dest .
89.It get Oo Fl p Ar admin principal Oc \
90Oo Fl Fl principal= Ns Ar admin principal Oc Oo Fl e Ar enctype Oc \
91Oo Fl Fl enctypes= Ns Ar enctype Oc Oo Fl r Ar realm Oc \
92Oo Fl Fl realm= Ns Ar realm Oc Oo Fl a Ar admin server Oc \
93Oo Fl Fl admin-server= Ns Ar admin server Oc Oo Fl s Ar server port Oc \
94Oo Fl Fl server-port= Ns Ar server port Oc Ar principal ...
95For each
96.Ar principal ,
97generate a new key for it (creating it if it doesn't already exist),
98and put that key in the keytab.
99.Pp
100If no
101.Ar realm
102is specified, the realm to operate on is taken from the first
103principal.
104.It list Oo Fl Fl keys Oc Op Fl Fl timestamp
105List the keys stored in the keytab.
106.It remove Oo Fl p Ar principal Oc Oo Fl Fl principal= Ns Ar principal Oc \
107Oo Fl V kvno Oc Oo Fl Fl kvno= Ns Ar kvno Oc Oo Fl e enctype Oc \
108Oo Fl Fl enctype= Ns Ar enctype Oc
109Removes the specified key or keys. Not specifying a
110.Ar kvno
111removes keys with any version number. Not specifying an
112.Ar enctype
113removes keys of any type.
114.It rename Ar from-principal Ar to-principal
115Renames all entries in the keytab that match the
116.Ar from-principal
117to
118.Ar to-principal .
119.It purge Op Fl Fl age= Ns Ar age
120Removes all old versions of a key for which there is a newer version
121that is at least
122.Ar age
123(default one week) old.
124.El
125.Sh SEE ALSO
126.Xr kadmin 8
127