/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
	"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY COMMANDNAME "mandos-ctl">
<!ENTITY TIMESTAMP "2019-03-09">
<!ENTITY % common SYSTEM "common.ent">
%common;
]>

<refentry xmlns:xi="http://www.w3.org/2001/XInclude">
  <refentryinfo>
    <title>Mandos Manual</title>
    <!-- NWalsh’s docbook scripts use this to generate the footer: -->
    <productname>Mandos</productname>
    <productnumber>&version;</productnumber>
    <date>&TIMESTAMP;</date>
    <authorgroup>
      <author>
	<firstname>Björn</firstname>
	<surname>Påhlsson</surname>
	<address>
	  <email>belorn@recompile.se</email>
	</address>
      </author>
      <author>
	<firstname>Teddy</firstname>
	<surname>Hogeborn</surname>
	<address>
	  <email>teddy@recompile.se</email>
	</address>
      </author>
    </authorgroup>
    <copyright>
      <year>2010</year>
      <year>2011</year>
      <year>2012</year>
      <year>2013</year>
      <year>2014</year>
      <year>2015</year>
      <year>2016</year>
      <year>2017</year>
      <year>2018</year>
      <year>2019</year>
      <holder>Teddy Hogeborn</holder>
      <holder>Björn Påhlsson</holder>
    </copyright>
    <xi:include href="legalnotice.xml"/>
  </refentryinfo>
  
  <refmeta>
    <refentrytitle>&COMMANDNAME;</refentrytitle>
    <manvolnum>8</manvolnum>
  </refmeta>
  
  <refnamediv>
    <refname><command>&COMMANDNAME;</command></refname>
    <refpurpose>
      Control or query the operation of the Mandos server
    </refpurpose>
  </refnamediv>
  
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&COMMANDNAME;</command>
      <group>
	  <arg choice="plain"><option>--verbose</option></arg>
	  <arg choice="plain"><option>-v</option></arg>
	  <sbr/>
	  <arg choice="plain"><option>--dump-json</option></arg>
	  <arg choice="plain"><option>-j</option></arg>
      </group>
      <arg><option>--debug</option></arg>
      <group>
	<arg rep='repeat' choice='plain'>
	  <replaceable>CLIENT</replaceable>
	</arg>
      </group>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>&COMMANDNAME;</command>
      <group choice="req">
	<group>
	  <arg choice="plain"><option>--enable</option></arg>
	  <arg choice="plain"><option>-e</option></arg>
	  <sbr/>
	  <arg choice="plain"><option>--disable</option></arg>
	  <arg choice="plain"><option>-d</option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--bump-timeout</option></arg>
	  <arg choice="plain"><option>-b</option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--start-checker</option></arg>
	  <arg choice="plain"><option>--stop-checker</option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--checker
	  <replaceable>COMMAND</replaceable></option></arg>
	  <arg choice="plain"><option>-c
	  <replaceable>COMMAND</replaceable></option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--timeout
	  <replaceable>TIME</replaceable></option></arg>
	  <arg choice="plain"><option>-t
	  <replaceable>TIME</replaceable></option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--extended-timeout
	  <replaceable>TIME</replaceable></option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--interval
	  <replaceable>TIME</replaceable></option></arg>
	  <arg choice="plain"><option>-i
	  <replaceable>TIME</replaceable></option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--approve-by-default</option
          ></arg>
	  <sbr/>
	  <arg choice="plain"><option>--deny-by-default</option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--approval-delay
	  <replaceable>TIME</replaceable></option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--approval-duration
	  <replaceable>TIME</replaceable></option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--host
	  <replaceable>STRING</replaceable></option></arg>
	  <arg choice="plain"><option>-H
	  <replaceable>STRING</replaceable></option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--secret
	  <replaceable>FILENAME</replaceable></option></arg>
	  <arg choice="plain"><option>-s
	  <replaceable>FILENAME</replaceable></option></arg>
	</group>
	<sbr/>
	<group>
	  <arg choice="plain"><option>--approve</option></arg>
	  <arg choice="plain"><option>-A</option></arg>
	  <sbr/>
	  <arg choice="plain"><option>--deny</option></arg>
	  <arg choice="plain"><option>-D</option></arg>
	</group>
      </group>
      <sbr/>
      <arg><option>--debug</option></arg>
      <group choice="req">
	<arg choice="plain"><option>--all</option></arg>
	<arg choice="plain"><option>-a</option></arg>
	<arg rep='repeat' choice='plain'>
	  <replaceable>CLIENT</replaceable>
	</arg>
      </group>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>&COMMANDNAME;</command>
      <group>
	<arg choice="plain"><option>--deny</option></arg>
	<arg choice="plain"><option>-D</option></arg>
      </group>
      <group choice="req">
	  <arg choice="plain"><option>--remove</option></arg>
	  <arg choice="plain"><option>-r</option></arg>
      </group>
      <sbr/>
      <arg><option>--debug</option></arg>
      <group choice="req">
	<arg choice="plain"><option>--all</option></arg>
	<arg choice="plain"><option>-a</option></arg>
	<arg rep='repeat' choice='plain'>
	  <replaceable>CLIENT</replaceable>
	</arg>
      </group>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>&COMMANDNAME;</command>
      <group choice="req">
	<arg choice="plain"><option>--is-enabled</option></arg>
	<arg choice="plain"><option>-V</option></arg>
      </group>
      <arg><option>--debug</option></arg>
      <arg choice='plain'><replaceable>CLIENT</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>&COMMANDNAME;</command>
      <group choice="req">
	<arg choice="plain"><option>--help</option></arg>
	<arg choice="plain"><option>-h</option></arg>
      </group>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>&COMMANDNAME;</command>
      <group choice="req">
	<arg choice="plain"><option>--version</option></arg>
	<arg choice="plain"><option>-v</option></arg>
      </group>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>&COMMANDNAME;</command>
      <arg choice="plain"><option>--check</option></arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  
  <refsect1 id="description">
    <title>DESCRIPTION</title>
    <para>
      <command>&COMMANDNAME;</command> is a program to control or
      query the operation of the Mandos server
      <citerefentry><refentrytitle>mandos</refentrytitle><manvolnum
      >8</manvolnum></citerefentry>.
    </para>
    <para>
      This program can be used to change client settings, approve or
      deny client requests, and to remove clients from the server.
    </para>
  </refsect1>
  
  <refsect1 id="purpose">
    <title>PURPOSE</title>
    <para>
      The purpose of this is to enable <emphasis>remote and unattended
      rebooting</emphasis> of client host computer with an
      <emphasis>encrypted root file system</emphasis>.  See <xref
      linkend="overview"/> for details.
    </para>
  </refsect1>
  
  <refsect1 id="options">
    <title>OPTIONS</title>
    
    <variablelist>
      <varlistentry>
	<term><option>--help</option></term>
	<term><option>-h</option></term>
	<listitem>
	  <para>
	    Show a help message and exit
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--enable</option></term>
	<term><option>-e</option></term>
	<listitem>
	  <para>
	    Enable client(s).  An enabled client will be eligble to
	    receive its secret.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--disable</option></term>
	<term><option>-d</option></term>
	<listitem>
	  <para>
	    Disable client(s).  A disabled client will not be eligble
	    to receive its secret, and no checkers will be started for
	    it.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--bump-timeout</option></term>
	<listitem>
	  <para>
	    Bump the timeout of the specified client(s), just as if a
	    checker had completed successfully for it/them.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--start-checker</option></term>
	<listitem>
	  <para>
	    Start a new checker now for the specified client(s).
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--stop-checker</option></term>
	<listitem>
	  <para>
	    Stop any running checker for the specified client(s).
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--remove</option></term>
	<term><option>-r</option></term>
	<listitem>
	  <para>
	    Remove the specified client(s) from the server.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--checker
	<replaceable>COMMAND</replaceable></option></term>
	<term><option>-c
	<replaceable>COMMAND</replaceable></option></term>
	<listitem>
	  <para>
	    Set the <varname>checker</varname> option of the specified
	    client(s); see <citerefentry><refentrytitle
	    >mandos-clients.conf</refentrytitle><manvolnum
            >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--timeout
	<replaceable>TIME</replaceable></option></term>
	<term><option>-t
	<replaceable>TIME</replaceable></option></term>
	<listitem>
	  <para>
	    Set the <varname>timeout</varname> option of the specified
	    client(s); see <citerefentry><refentrytitle
	    >mandos-clients.conf</refentrytitle><manvolnum
            >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term><option>--extended-timeout
	<replaceable>TIME</replaceable></option></term>
	<listitem>
	  <para>
	    Set the <varname>extended_timeout</varname> option of the
	    specified client(s); see <citerefentry><refentrytitle
	    >mandos-clients.conf</refentrytitle><manvolnum
	    >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--interval
	<replaceable>TIME</replaceable></option></term>
	<term><option>-i
	<replaceable>TIME</replaceable></option></term>
	<listitem>
	  <para>
	    Set the <varname>interval</varname> option of the
	    specified client(s); see <citerefentry><refentrytitle
	    >mandos-clients.conf</refentrytitle><manvolnum
            >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--approve-by-default</option></term>
	<term><option>--deny-by-default</option></term>
	<listitem>
	  <para>
	    Set the <varname>approved_by_default</varname> option of
	    the specified client(s) to <literal>True</literal> or
	    <literal>False</literal>, respectively; see
	    <citerefentry><refentrytitle
            >mandos-clients.conf</refentrytitle><manvolnum
            >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--approval-delay
	<replaceable>TIME</replaceable></option></term>
	<listitem>
	  <para>
	    Set the <varname>approval_delay</varname> option of the
	    specified client(s); see <citerefentry><refentrytitle
	    >mandos-clients.conf</refentrytitle><manvolnum
            >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--approval-duration
	<replaceable>TIME</replaceable></option></term>
	<listitem>
	  <para>
	    Set the <varname>approval_duration</varname> option of the
	    specified client(s); see <citerefentry><refentrytitle
	    >mandos-clients.conf</refentrytitle><manvolnum
            >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--host
	<replaceable>STRING</replaceable></option></term>
	<term><option>-H
	<replaceable>STRING</replaceable></option></term>
	<listitem>
	  <para>
	    Set the <varname>host</varname> option of the specified
	    client(s); see <citerefentry><refentrytitle
	    >mandos-clients.conf</refentrytitle><manvolnum
            >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--secret
	<replaceable>FILENAME</replaceable></option></term>
	<term><option>-s
	<replaceable>FILENAME</replaceable></option></term>
	<listitem>
	  <para>
	    Set the <varname>secfile</varname> option of the specified
	    client(s); see <citerefentry><refentrytitle
	    >mandos-clients.conf</refentrytitle><manvolnum
            >5</manvolnum></citerefentry>.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--approve</option></term>
	<term><option>-A</option></term>
	<listitem>
	  <para>
	    Approve client(s) if currently waiting for approval.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--deny</option></term>
	<term><option>-D</option></term>
	<listitem>
	  <para>
	    Deny client(s) if currently waiting for approval.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--all</option></term>
	<term><option>-a</option></term>
	<listitem>
	  <para>
	    Make the client-modifying options modify <emphasis
	    >all</emphasis> clients.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--verbose</option></term>
	<term><option>-v</option></term>
	<listitem>
	  <para>
	    Show all client settings, not just a subset.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--dump-json</option></term>
	<term><option>-j</option></term>
	<listitem>
	  <para>
	    Dump client settings as JSON to standard output.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--is-enabled</option></term>
	<term><option>-V</option></term>
	<listitem>
	  <para>
	    Check if a single client is enabled or not, and exit with
	    a successful exit status only if the client is enabled.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--debug</option></term>
	<listitem>
	  <para>
	    Show debug output; currently, this means show D-Bus calls.
	  </para>
	</listitem>
      </varlistentry>
      
      <varlistentry>
	<term><option>--check</option></term>
	<listitem>
	  <para>
	    Run self-tests.  This includes any unit tests, etc.
	  </para>
	</listitem>
      </varlistentry>
      
    </variablelist>
  </refsect1>
  
  <refsect1 id="overview">
    <title>OVERVIEW</title>
    <xi:include href="overview.xml"/>
    <para>
      This program is a small utility to generate new OpenPGP keys for
      new Mandos clients, and to generate sections for inclusion in
      <filename>clients.conf</filename> on the server.
    </para>
  </refsect1>
  
  <refsect1 id="exit_status">
    <title>EXIT STATUS</title>
    <para>
      If the <option>--is-enabled</option> option is used, the exit
      status will be 0 only if the specified client is enabled.
    </para>
  </refsect1>
  
  <refsect1 id="bugs">
    <title>BUGS</title>
    <xi:include href="bugs.xml"/>
  </refsect1>
  
  <refsect1 id="example">
    <title>EXAMPLE</title>
    <informalexample>
      <para>
	To list all clients:
      </para>
      <para>
	<userinput>&COMMANDNAME;</userinput>
      </para>
    </informalexample>
    
    <informalexample>
      <para>
	To list <emphasis>all</emphasis> settings for the clients
        named <quote>foo1.example.org</quote> and <quote
        >foo2.example.org</quote>:
      </para>
      <para>

<!-- do not wrap this line -->
<userinput>&COMMANDNAME; --verbose foo1.example.org foo2.example.org</userinput>

      </para>
    </informalexample>
    
    <informalexample>
      <para>
	To enable all clients:
      </para>
      <para>
	<userinput>&COMMANDNAME; --enable --all</userinput>
      </para>
    </informalexample>
    
    <informalexample>
      <para>
	To change timeout and interval value for the clients
        named <quote>foo1.example.org</quote> and <quote
        >foo2.example.org</quote>:
      </para>
      <para>

<!-- do not wrap this line -->
<userinput>&COMMANDNAME; --timeout="PT5M" --interval="PT1M" foo1.example.org foo2.example.org</userinput>

      </para>
    </informalexample>
    
    <informalexample>
      <para>
	To approve all clients currently waiting for it:
      </para>
      <para>
	<userinput>&COMMANDNAME; --approve --all</userinput>
      </para>
    </informalexample>
  </refsect1>
  
  <refsect1 id="security">
    <title>SECURITY</title>
    <para>
      This program must be permitted to access the Mandos server via
      the D-Bus interface.  This normally requires the root user, but
      could be configured otherwise by reconfiguring the D-Bus server.
    </para>
  </refsect1>
  
  <refsect1 id="see_also">
    <title>SEE ALSO</title>
    <para>
      <citerefentry><refentrytitle>intro</refentrytitle>
      <manvolnum>8mandos</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>mandos</refentrytitle>
      <manvolnum>8</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>mandos-clients.conf</refentrytitle>
      <manvolnum>5</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>mandos-monitor</refentrytitle>
      <manvolnum>8</manvolnum></citerefentry>
    </para>
  </refsect1>
  
</refentry>
<!-- Local Variables: -->
<!-- time-stamp-start: "<!ENTITY TIMESTAMP [\"']" -->
<!-- time-stamp-end: "[\"']>" -->
<!-- time-stamp-format: "%:y-%02m-%02d" -->
<!-- End: -->