overhaul monkeysphere-host(8) to match new multi-key capable interface
[monkeysphere.git] / man / man8 / monkeysphere-host.8
1 .TH MONKEYSPHERE-HOST "8" "January 2010" "monkeysphere" "System Commands"
2
3 .SH NAME
4
5 monkeysphere\-host - Monkeysphere host key administration tool.
6
7 .SH SYNOPSIS
8
9 .B monkeysphere\-host \fIsubcommand\fP [\fIargs\fP]
10
11 .SH DESCRIPTION
12
13 \fBMonkeysphere\fP is a framework to leverage the OpenPGP web of trust
14 for SSH and TLS key-based authentication.
15
16 \fBmonkeysphere\-host\fP stores and manages OpenPGP certificates for
17 various services offered by the host.
18
19 Most subcommands take a KEYID argument, which identifies (by OpenPGP
20 key ID (e.g. 0xDEADBEEF) or full OpenPGP fingerprint) which
21 certificate is to be operated upon.  If only one certificate is
22 currently managed by \fBmonkeysphere\-host\fP, the KEYID argument may
23 be omitted, \fBmonkeysphere\-host\fP will operate on it.
24
25 .SH SUBCOMMANDS
26
27 \fBmonkeysphere\-host\fP takes various subcommands:
28 .TP
29 .B import\-key FILE SCHEME://HOSTNAME[:PORT]
30 Import a PEM-encoded host secret key from file FILE.  If FILE is `\-',
31 then the key will be imported from stdin.  Only RSA keys are supported
32 at the moment.  SCHEME://HOSTNAME[:PORT] is used to specify the scheme
33 (e.g. ssh or https), fully-qualified hostname (and port) used in the
34 user ID of the new OpenPGP key (e.g. ssh://example.net or
35 https://www.example.net).  If PORT is not specified, then no port is
36 added to the user ID, which means the default port for that service
37 (e.g. 22 for ssh) is assumed.  `i' may be used in place of
38 `import\-key'.
39 .TP
40 .B show\-key [KEYID ...]
41 Output information about the OpenPGP certificate(s) for services
42 offered by the host, including their KEYIDs.  If no KEYID is specified
43 (or if the special string `--all' is used), output information about
44 all certificates managed by \fBmonkeysphere\-host\fP.  `s' may be used
45 in place of `show\-key'.
46 .TP
47 .B set\-expire EXPIRE [KEYID]
48 Extend the validity of the OpenPGP certificate specified until EXPIRE
49 from the present.  Expiration is specified as with GnuPG (measured
50 from today's date):
51 .nf
52          0 = key does not expire
53       <n>  = key expires in n days
54       <n>w = key expires in n weeks
55       <n>m = key expires in n months
56       <n>y = key expires in n years
57 .fi
58 `e' may be used in place of `set\-expire'.
59 .TP
60 .B add\-servicename SCHEME://HOSTNAME[:PORT] [KEYID]
61 Add a service-specific user ID to the specified certificate.  For
62 example, the operator of `https://example.net' may wish to add an
63 additional servicename of `https://www.example.net' to the certificate
64 corresponding to the secret key used by the TLS-enabled web server.
65 `n+' may be used in place of `add\-hostname'.
66 .TP
67 .B revoke\-servicename SCHEME://HOSTNAME[:PORT] [KEYID]
68 Revoke a service-specific user ID from the specified certificate.
69 `n\-' may be used in place of `revoke\-hostname'.
70 .TP
71 .B add\-revoker REVOKER_KEYID|FILE [KEYID]
72 Add a revoker to the specified OpenPGP certificate.  The revoker can
73 be specified by their own REVOKER_KEYID (in which case it will be
74 loaded from an OpenPGP keyserver), or by specifying a path to a file
75 containing the revoker's OpenPGP certificate, or by specifying `\-' to
76 load from stdin.  `r+' may be be used in place of `add-revoker'.
77 .TP
78 .B revoke\-key [KEYID]
79 Generate (with the option to publish) a revocation certificate for
80 given OpenPGP certificate.  If such a certificate is published, the
81 given key will be permanently revoked, and will no longer be accepted
82 by monkeysphere-enabled clients.  This subcommand will ask you a
83 series of questions, and then generate a key revocation certificate,
84 sending it to stdout.  You might want to store these certificates
85 safely offline, to publish in case of compromise).  If you explicitly
86 tell it to publish the revocation certificate immediately, it will
87 send it to the public keyservers.  PUBLISH THESE CERTIFICATES ONLY IF
88 YOU ARE SURE THE CORRESPONDING KEY WILL NEVER BE RE-USED!
89 .TP
90 .B publish\-key [KEYID ...]
91 Publish the specified OpenPGP certificates to the public keyservers.
92 If the special string `--all' is specified, all of the host's OpenPGP
93 certificates will be published.  `p' may be used in place of
94 `publish-key'.  Note that there is no way to remove a key from the
95 public keyservers once it is published!
96 .TP
97 .B version
98 Show the monkeysphere version number.  `v' may be used in place of
99 `version'.
100 .TP
101 .B help
102 Output a brief usage summary.  `h' or `?' may be used in place of
103 `help'.
104
105
106 Other commands:
107 .TP
108 .B diagnostics
109 Review the state of the monkeysphere server host key and report on
110 suggested changes.  Among other checks, this includes making sure
111 there is a valid host key, that the key is not expired, that the sshd
112 configuration points to the right place, etc.  `d' may be used in
113 place of `diagnostics'.
114
115 .SH SETUP SSH SERVER CERTIFICATES
116
117 To enable users to verify your SSH host's key via the monkeysphere, an
118 OpenPGP certificate must be made out of the host's RSA ssh key, and
119 the certificate must be published to the Web of Trust.  Certificate
120 publication is not done by default.  The first step is to import the
121 host's ssh key into a monkeysphere-style OpenPGP certificate.  This is
122 done with the import\-key command.  For example:
123
124 # monkeysphere\-host import\-key /etc/ssh/ssh_host_rsa_key ssh://host.example.org
125
126 On most systems, sshd's RSA secret key is stored at
127 /etc/ssh/ssh_host_rsa_key.
128
129 See PUBLISHING AND CERTIFYING MONKEYSPHERE SERVICE CERTIFICATES for
130 how to make sure your users can verify the ssh service offered by your
131 host once the key is imported into \fBmonkeysphere\-host\fP.
132
133 .SH SETUP WEB SERVER CERTIFICATES
134
135 You can set up your HTTPS-capable web server so that your users can
136 verify it via the monkeysphere, without changing your server's
137 software at all.  You just need access to a (PEM-encoded) version of
138 the server's RSA secret key (most secret keys are already stored
139 PEM-encoded).  The first step is to import the web server's key into a
140 monkeysphere-style OpenPGP certificate.  This is done with the
141 import\-key command.  For example:
142
143 # monkeysphere\-host import-key /etc/ssl/private/host.example.net-key.pem https://host.example.net
144
145 If you don't know where the web server's key is stored on your
146 machine, consult the configuration files for your web server.
147 Debian-based systems using the `ssl-cert' packages often have a
148 default self-signed certificate stored in
149 `/etc/ssl/private/ssl-cert-snakeoil.key' ; if you're using that key,
150 your users are getting browser warnings about it.  You can keep using
151 the same key, but help them use the OpenPGP WoT to verify that it does
152 belong to your web server by using something like:
153
154 # monkeysphere\-host import-key /etc/ssl/private/ssl-cert-snakeoil.key https://$(hostname --fqdn)
155
156 If you offer multiple HTTPS websites using the same secret key, you
157 should add the additional website names with the `add-servicename'
158 subcommand.
159
160 See PUBLISHING AND CERTIFYING MONKEYSPHERE SERVICE CERTIFICATES (the
161 next section) for how to make sure your users can verify the https
162 service offered by your host once the key is imported and any extra
163 site names have been added.  Note that you can add or remove
164 additional servicenames at any time, but you'll need to certify any
165 new ones separately.
166
167 .SH PUBLISHING AND CERTIFYING MONKEYSPHERE SERVICE CERTIFICATES
168
169 Once the host key has been imported, the corresponding certificate
170 must be published to the Web of Trust so that users can retrieve the
171 cert when connecting to the host.  The host certificates are published
172 to the keyserver with the publish\-key command:
173
174 $ monkeysphere\-host publish\-key --all
175
176 In order for users accessing the system to be able to identify the
177 host's service via the monkeysphere, at least one person (e.g. a
178 server admin) will need to sign the host's certificate.  This is done
179 using standard OpenPGP keysigning techniques.  Usually: pull the
180 host's OpenPGP certificate from the keyserver, verify and sign it, and
181 then re-publish your signature.  More than one person can certify any
182 certificate.  Please see
183 http://web.monkeysphere.info/signing-host-keys/ for more information
184 and details.  Once an admin's signature is published, users accessing
185 the host can use the certificate to validate the host's key without
186 having to manually check the host key's fingerprint (in the case of
187 ssh) or without seeing a nasty "security warning" in their browsers
188 (in the case of https).
189
190 .SH SECURITY CONSIDERATIONS
191
192 Note that \fBmonkeysphere\-host\fP currently caches a copy of all
193 imported secret keys (stored in OpenPGP form for future manipulation)
194 in /var/lib/monkeysphere/host/secring.gpg.  Cleartext backups of this
195 file could expose secret key material if not handled sensitively.
196
197 .SH ENVIRONMENT
198
199 The following environment variables will override those specified in
200 the config file (defaults in parentheses):
201 .TP
202 MONKEYSPHERE_LOG_LEVEL
203 Set the log level.  Can be SILENT, ERROR, INFO, VERBOSE, DEBUG, in
204 increasing order of verbosity. (INFO)
205 .TP
206 MONKEYSPHERE_KEYSERVER
207 OpenPGP keyserver to use. (pool.sks\-keyservers.net)
208 .TP
209 MONKEYSPHERE_PROMPT
210 If set to `false', never prompt the user for confirmation. (true)
211
212 .SH FILES
213
214 .TP
215 /etc/monkeysphere/monkeysphere\-host.conf
216 System monkeysphere\-host config file.
217 .TP
218 /var/lib/monkeysphere/host_keys.pub.gpg
219 A world-readable copy of all of the host's public keys in OpenPGP
220 format, including all relevant self-signatures.
221 .TP
222 /var/lib/monkeysphere/host/
223 A locked directory (readable only by the superuser) containing copies
224 of all imported secret keys.
225
226 .SH AUTHOR
227
228 This man page was written by:
229 Jameson Rollins <jrollins@fifthhorseman.net>,
230 Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
231 Matthew Goins <mjgoins@openflows.com>
232
233 .SH SEE ALSO
234
235 .BR monkeysphere (1),
236 .BR monkeysphere\-authentication (8),
237 .BR monkeysphere (7),
238 .BR gpg (1),
239 .BR ssh (1),
240 .BR sshd (8)