Added configuration option "tcp_wait". Sets the time to wait for a new
[pwmd.git] / doc / pwmd.1.in
blob43d3f3aa021660c7e5a5a14692718a86bc72ce56
1 .\" This program is free software; you can redistribute it and/or modify
2 .\" it under the terms of the GNU General Public License as published by
3 .\" the Free Software Foundation; either version 2 of the License, or
4 .\" (at your option) any later version.
5 .\" 
6 .\" This program is distributed in the hope that it will be useful,
7 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
8 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9 .\" GNU General Public License for more details.
10 .\" 
11 .\" You should have received a copy of the GNU General Public License
12 .\" along with this program; if not, write to the Free Software
13 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02110-1301  USA
14 .de URL
15 \\$2 \(laURL: \\$1 \(ra\\$3
17 .if \n[.g] .mso www.tmac
18 .TH PWMD 1 "15 Nov 2008" "Password Manager Daemon" "Password Manager Daemon"
19 .SH NAME
21 pwmd \- a universal data server
22 .SH SYNOPSIS
23 .B pwmd
24 [\-hvDnP] [\-f <rcfile>] [\-I <filename> [\-i <iterations>] [\-k <keyfile>]
25 \-o <filename>] [\-C <filename> \-o <filename>] [file] [...]
27 .SH DESCRIPTION
28 .B pwmd
29 is a daemon/server that serves clients data which is stored in a, optionally
30 encrypted and compressed, XML data file. Clients connect and send commands
31 that either retrieve or store data.
33 .SH OPTIONS
34 The following are the available command line options. Remaining arguments are
35 files to add to the cache on startup.
36 .TP
37 .I "\-f rcfile"
38 Specify an alternate configuration file. The default is \fI~/.pwmd/config\fR.
39 .TP
40 .I "\-I filename \-o filename"
41 Imports an XML file. The XML file should be in conformance to the pwmd DTD.
42 See COMMANDS contained in the distributed pwmd archive for details. If
43 encryption is wanted (specified with the \fIiterations\fP configuration
44 parameter or the \fI\-i\fP command line switch), you will be prompted for a
45 passphrase to encrypt with. The output is written to the filename specified
46 with the \fI\-o\fP command line switch which should then be placed in the
47 configured \fIdata_directory\fP.
48 .TP
49 .I "\-i iterations
50 The number of encryption iterations to use when importing. When not specified,
51 the \fIiterations\fP configuration option from the \fIglobal\fP section will
52 be used.
53 .TP
54 .I "\-k keyfile"
55 When importing, obtain the key from the specified filename. Only the first
56 line is read from this file. Be sure to set \fIkey_file\fP in your
57 configuration.
58 .TP
59 .I "\-C filename \-o filename"
60 Converts a \fBpwmd\fP version 1 data file to a version 2 data file. If
61 encrypted, you will be prompted for a passphrase to use for decryption. The
62 converted data file will be saved to the filename specified with the \fI-o\fP
63 command line switch and with the same passphrase and iterations as the
64 version 1 data file.
65 .TP
66 .I "\-D"
67 Disable the LIST and DUMP protocol commands.
68 .TP
69 .I "\-n"
70 Run as a foreground process.
71 .TP
72 .I "\-P"
73 Disable
74 .BR pinentry (1)
75 support. Overrides and configuration setting.
76 .TP
77 .I "\-v"
78 Version information.
79 .TP
80 .I "\-h"
81 Help text.
83 .SH CONFIGURATION FILE
84 Blank lines and lines beginning with '#' are ignored. Some options can be
85 grouped together to have file specific settings. A file section is declared by
86 surrounding the filename with braces (i.e., \fI[filename]\fP). Global options
87 may be specified in a \fI[global]\fP section and are the defaults for other
88 file sections. If the first character of a string value is a tilde, it will be
89 expanded to your home directory. First the global options:
90 .TP
91 .I "socket_path=<string>"
92 Listen on the specified socket. The default is \fI~/.pwmd/socket\fR.
93 .TP
94 .I "socket_perms=<integer>"
95 Permissions to set after creating the socket. This will override any
96 .BR umask (2)
97 setting.
98 .TP
99 .I "enable_tcp=<boolean>"
100 Whether to enable TCP server support. The default is \fIdisabled\fP. See
101 \fBTCP SUPPORT\fP below.
103 .I "tcp_port=<integer>"
104 The port to listen on when \fIenable_tcp\fP is \fItrue\fP. The default is
105 \fI6466\fP.
107 .I "tcp_interface=<string>"
108 Only useful when run as root.
110 .I "tcp_access=[!]<string>"
111 A comma separated list of client x509 certificate fingerprints in MD5 format
112 that will be allowed to open a file. If prefixed with \fB!\fP, access is
113 denied for the specified certificate. The access control is used in the OPEN
114 command for the specified filename.  This option can be in either the
115 \fBglobal\fP section or a defined \fBfilename\fP section. If not found in
116 either then access will be granted. If defined but empty then access will be
117 denied.
119 .I "tcp_require_key=<boolean>"
120 Require the client to provide the key to open a file even if the file is
121 cached. The default is \fIfalse\fP.
123 .I "tcp_wait=<integer>"
124 The time in tenths of a second to wait for a new connection. The default is
125 \fB3\fP. Setting to \fB0\fP will disable waiting.
127 .I "data_directory=<string>"
128 Where
129 .B pwmd
130 should store and retrieve data files. The default is \fI~/.pwmd/data\fR.
132 .I "disable_mlockall=<boolean>"
133 When set to \fBfalse\fP,
134 .BR mlockall (2)
135 will be called after the client connects. This will use alot more physical
136 memory but may also be more secure. Most will probably find it overkill since
137 the contents of all memory is cleared before being freed. Note that this
138 doesn't affect the file cache which is always stored in RAM (if possible).
140 .I "cache_size=<integer>"
141 Specfies the size of the file cache. Must be in multiples of your systems
142 \fBPAGE_SIZE\fR. The default is one page.
144 .I "log_path=<string>"
145 Logs informational messages to the specified file. The default is
146 \fI~/.pwmd/log\fR.
148 .I "enable_logging=<boolean>"
149 Enable or disable logging to \fIlog_path\fR. The default is \fIfalse\fR.
151 .I "syslog=<boolean>"
152 Enable logging to
153 .BR syslog (8)
154 with facility LOG_DAEMON and priority LOG_INFO. The default is \fIfalse\fR.
156 .I "cache_push=<list>"
157 A list of filenames separated by commas that will be pushed into the file
158 cache upon startup.
159 .B pwmd
160 will ask for the key for each file specified unless the key was specified with
161 the \fBkey\fR or \fBkey_file\fR parameters in a matching file section. The
162 default is none.
164 .I "priority=<integer>"
165 The priority, or niceness, of the server. The default is inherited from the
166 parent process.
168 Below are options that can be in the \fI[global]\fP or \fI[filename]\fP
169 section. If in both then \fI[filename]\fP will have precedence.
171 .I "backup=<boolean>"
172 Whether a backup of the data file should be kept when saving. The default is
173 \fItrue\fP. The backup filename has the .backup extension appended to the
174 opened file.
176 .I "cache_timeout=<integer>"
177 The number of seconds for the life of the cached file. If \fI-1\fP, the file
178 is cached forever. If \fI0\fP, each time the file is opened or saved a key
179 will be required.
181 .I "enable_pinentry=<boolean>"
182 If \fIfalse\fP, disable the use of
183 .BR pinentry (1).
184 The default is \fItrue\fP. Also see \fBPINENTRY\fP below.
186 .I "pinentry_timeout=<integer>"
187 The number of seconds before the pinentry dialog will terminate while waiting
188 for a password. Set to \fI0\fP to wait forever.
190 .I "iterations=<integer>"
191 The number of times to encrypt the data. A value of 10000 or more will make
192 dictionary attacks very slow depending on the CPU. The default is \fI0\fP
193 which is really 1 iteration (data file compatibility bug). Setting to \fI-1\fP
194 will disable encryption.
196 .I "iteration_progress=<integer>"
197 After the specified number of iterations while encrypting or decrypting, a
198 status message with the keyword \fBPROGRESS\fP will be sent to the client.
199 Setting to \fI0\fP, the default, disables sending progress messages.
201 .I "key=<string>"
202 The initial key to use for this file. If specified in the \fI[global]\fP
203 section then "\fIglobal\fP" is treated as a filename and not a default for
204 other files. Note that if a client changes the key this value is not modified
205 and will need to be updated by hand.
207 .I "key_file=<string>"
208 Same as above but obtain the key from the specified filename with the key
209 being on the first line of the file. Note that if you change the key when
210 connected this value is not modified and will need to be updated by hand.
212 .I "compression_level=<integer>"
213 The default compression level for data files from \fI1\fP to \fI9\fP, \fI1\fP
214 being the fastest but least compression and \fI9\fP being the slowest but best
215 compression. To disable compression entirely, set to \fI0\fP. The default is
216 \fI6\fP.
218 .I "zlib_bufsize=<integer>"
219 The input and output buffer size when compressing and decompressing. This
220 affects how often the COMPRESS and DECOMPRESS status messages are sent and
221 also affects compression quality. The default is \fB65536\fP. Set to a higher
222 value for larger files.
224 .I "recursion_depth=<integer>"
225 The maximum number of times to resolve a target attribute for a single element
226 in an element path. An error is returned when this value is exceeded. The
227 default is \fI20\fP but can be disabled by setting to \fI0\fP.
229 .I "keepalive=<integer>"
230 Sends keep alive status messages to the client every N seconds. Set to \fI0\fP
231 to disable. The default is \fI5\fP.
233 .SH PINENTRY
235 When \fIenable_pinentry\fP is \fBtrue\fP, commands that require a key that
236 isn't cached or specified with the command, will use
237 .BR pinentry (1)
238 to retrieve the passphrase. Since \fBpwmd\fP is a daemon process, it isn't
239 attached to any terminal. So \fBpinentry\fP needs to know where to put it's
240 dialog box by using command line options when executed. These can be set by
241 either using protocol commands (see COMMANDS included in the archive) or by
242 creating a file \fI~/.pwmd/pinentry.conf\fP. When using the file, each line should
243 contain NAME=VALUE pairs where NAME is one of:
245 .B TTYNAME
246 The full path of the tty device.
248 .B TTYTYPE
249 The terminal type (i.e., vt100).
251 .B DISPLAY
252 If using an X11 pinentry.
254 .B PATH
255 The full path to the pinentry binary. The default is \fI@pinentry@\fP.
257 The file is read only once after each client first connects. Note that if your
258 not using a \fBDISPLAY\fP, then both \fBTTYNAME\fP and \fBTTYTYPE\fP should be
259 set otherwise you'll get a segfault from ncurses.
261 .SH TCP SUPPORT
262 When compiled with TCP support and \fIenable_tcp\fP is \fItrue\fP, \fBpwmd\fP
263 can accept connections from remote hosts. Authentication is done with X509
264 certificates. The server certificate should be signed by a certificate
265 authority (CA), which will probably be a locally generated one (see the
266 .BR certtool (1)
267 documentation for how to do this). When a client connects, \fBpwmd\fP
268 will require the client to send a certificate that was signed by the same
269 certificate authority that was used to sign the \fBpwmd\fP server certificate
270 (\fB~/.pwmd/ca-cert.pem\fP). After the client certificate is validated,
271 \fBpwmd\fP will accept commands from the client.
273 .SH SIGNALS
275 .B SIGUSR1
276 Clears the entire file cache. If there are any clients connected, a key will
277 be required for the next \fBOPEN\fP or \fBSAVE\fP command.
279 .B SIGHUP
280 Reloads the configuration file.
282 .B SIGTERM and SIGINT
283 Disallows new connections and waits for all clients to disconnect before
284 terminating.
286 .SH FILES
288 .B ~/.pwmd/config
289 Default configuration file.
291 .B ~/.pwmd/data
292 Default data directory.
294 .B ~/.pwmd/socket
295 Default listening socket.
297 .B ~/.pwmd/log
298 Default log file when logging is enabled.
300 .B @pinentry@
301 Default location of the pinentry binary.
303 .B ~/.pwmd/pinentry.conf
304 Default pinentry settings for new clients.
306 .B ~/.pwmd/ca-cert.pem
307 The certificate authority (CA) than was used to sign the server (and client)
308 certificate.
310 .B ~/.pwmd/server-cert.pem
311 The pwmd server certificate. This is sent to the client. Clients should check
312 the validity of it to ensure that the \fBpwmd\fP server hasn't been hijacked.
314 .B ~/.pwmd/server-key.pem
315 The key that was used to sign the server certificate.
317 .SH AUTHOR
318 Ben Kibbey <bjk@luxsci.net>
320 .URL "http://bjk.sourceforge.net/pwmd/" "PWMD Homepage" .
322 .SH "SEE ALSO"
323 .BR certtool (1),
324 .BR pinentry (1),
325 .BR mlock (2),
326 .BR mlockall (2),
327 .BR libxml (3) ,
328 .BR mmap (2)
330 Also see \fBCOMMANDS\fP included in the archive for protocol commands and
331 syntax.