Check for EDEADLK in MUTEX_UNLOCK. It can be ignored since EDEADLK in
[pwmd.git] / doc / pwmd.1.in
blob572543a5edc4ca19239f8096ae5b03a48a275dce
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 "25 Feb 2009" "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 [\-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 \fB\-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 (\fB-I\fP) or converting (\fB-C\fP), obtain the key from the
56 specified filename. Only the first line is read from this file. Be sure to set
57 \fIkey_file\fP in your 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 (unless
62 using \fB-k\fP). The converted data file will be saved to the filename
63 specified with the \fB-o\fP command line switch and with the same passphrase
64 and iterations as the version 1 data file.
65 .TP
66 .I "\-D"
67 Disable the XPATH, 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 overriding any 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 have
85 data file-specific settings by placing them in a file section. A file section
86 is declared by surrounding the filename with braces (i.e., \fI[filename]\fP).
87 Global options may be specified in a \fI[global]\fP section and are the
88 default options for new or unspecified files. If the first character of a
89 string value is a tilde, it will be expanded to your home directory. First the
90 global options:
91 .TP
92 .I "socket_path=<string>"
93 Listen on the specified socket. The default is \fI~/.pwmd/socket\fR.
94 \fBpwmd\fP will always listen on a local socket.
95 .TP
96 .I "socket_perms=<integer>"
97 Permissions to set after creating the socket. This will override any
98 .BR umask (2)
99 setting.
101 .I "enable_tcp=<boolean>"
102 Whether to enable TCP server support. The default is \fIdisabled\fP. See
103 \fBTCP SUPPORT\fP below.
105 .I "tcp_port=<integer>"
106 The port to listen on when \fIenable_tcp\fP is \fItrue\fP. The default is
107 \fI6466\fP.
109 .I "tcp_interface=<string>"
110 Only useful when run as root.
112 .I "tcp_wait=<integer>"
113 The time in tenths of a second to wait for a new connection. The default is
114 \fB3\fP. Setting to \fB0\fP will disable waiting. This can be used to prevent
115 denial-of-service attacks.
117 .I "cipher_priority=<string>"
118 The GnuTLS cipher suite and protocol to use. The default is \fBSECURE256\fP.
119 See the 
120 .BR gnutls-cli (1)
121 documentation for more information.
123 .I "data_directory=<string>"
124 Where
125 .B pwmd
126 should store and retrieve data files. The default is \fI~/.pwmd/data\fR.
128 .I "disable_mlockall=<boolean>"
129 When set to \fBfalse\fP,
130 .BR mlockall (2)
131 will be called after the client connects. This will use alot more physical
132 memory but may also be more secure. Most will probably find it overkill since
133 the contents of all allocated memory is cleared before being freed. Note that
134 this doesn't affect the file cache which is always stored in RAM (if
135 possible).
137 .I "log_path=<string>"
138 Logs informational messages to the specified file. The default is
139 \fI~/.pwmd/log\fR.
141 .I "enable_logging=<boolean>"
142 Enable or disable logging to \fIlog_path\fR. The default is \fIfalse\fR.
144 .I "syslog=<boolean>"
145 Enable logging to
146 .BR syslog (8)
147 with facility LOG_DAEMON and priority LOG_INFO. The default is \fIfalse\fR.
149 .I "disable_list_and_dump=<boolean>"
150 When \fItrue\fP, the \fBXPATH\fP, \fBLIST\fP and \fBDUMP\fP protocol commands
151 will be disabled and will return an error code.
153 .I "cache_push=<list>"
154 A list of filenames separated by commas that will be pushed into the file
155 cache upon startup.
156 .B pwmd
157 will ask for the key for each file specified unless the key was specified with
158 the \fBkey\fR or \fBkey_file\fR parameters in a matching file section. The
159 default is none.
161 .I "priority=<integer>"
162 The priority, or niceness, of the server. The default is inherited from the
163 parent process.
165 Below are options that can be specified in the \fI[global]\fP or
166 \fI[filename]\fP section. If in both then \fI[filename]\fP will have
167 precedence.
169 .I "backup=<boolean>"
170 Whether to create a backup of the data file when saving. The default is
171 \fItrue\fP. The backup filename has the .backup extension appended to the
172 opened file.
174 .I "cache_timeout=<integer>"
175 The number of seconds to keep the cache entry for this file. If \fI-1\fP, the
176 cache entry is kept forever. If \fI0\fP, each time the file is opened or saved
177 a key will be required.
179 .I "enable_pinentry=<boolean>"
180 If \fIfalse\fP, disable the use of
181 .BR pinentry (1).
182 When disabled and a file requires a passphrase, the passphrase must be
183 included in the command (see COMMANDS included in the archive). The default is
184 \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 passphrase. The default is \fB20\fP. 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 \fI1\fP
193 iteration. Setting to \fI0\fP will disable encryption.
195 .I "iteration_progress=<integer>"
196 After the specified number of iterations have been processed while encrypting
197 or decrypting, a status message with the keyword \fBPROGRESS\fP will be sent
198 to the client.  Setting to \fI0\fP, the default, disables sending progress
199 messages.
201 .I "key=<string>"
202 The initial passphrase to use for this file. If specified in the
203 \fI[global]\fP section then "\fIglobal\fP" is treated as a data filename and
204 not a default for other files. Note that if a client changes the passphrase
205 for this data file with the \fBSAVE\fP command, then this value is not
206 modified and will need to be updated by hand.
208 .I "key_file=<string>"
209 Same as the \fBkey\fP option above but obtains the key from the specified
210 filename with the key being on the first line of the file. Note that if the
211 cache entry for this file gets removed then the only way to have it added
212 again is to restart \fBpwmd\fP or to re-read the configuration file (i.e., you
213 won't be prompted from pinentry).
215 .I "compression_level=<integer>"
216 The default compression level for data files from \fI1\fP to \fI9\fP, \fI1\fP
217 being the fastest but least compression and \fI9\fP being the slowest but best
218 compression. To disable compression entirely, set to \fI0\fP. The default is
219 \fI6\fP.
221 .I "zlib_bufsize=<integer>"
222 The input and output buffer size when compressing and decompressing. This
223 affects how often the COMPRESS and DECOMPRESS status messages are sent and
224 also affects compression quality. The default is \fB65536\fP. Set to a higher
225 value for larger files.
227 .I "recursion_depth=<integer>"
228 The maximum number of times to resolve a target attribute for a single element
229 in an element path. An error is returned when this value is exceeded. The
230 default is \fI20\fP but can be disabled by setting to \fI0\fP.
232 .I "keepalive=<integer>"
233 Sends keep alive status messages to the client every N seconds. Set to \fI0\fP
234 to disable. The default is \fI5\fP.
236 .I "tcp_access=[!]<string>"
237 A comma separated list of client x509 certificate fingerprints in SHA-1 format
238 that will be allowed to open a file. If prefixed with \fB!\fP, access is
239 denied for the specified certificate. The access control is checked only when
240 a client sends the OPEN command. If found in neither the \fBglobal\fP or
241 filename sections then access will be granted. If defined but empty then
242 access will be denied.
244 .I "tcp_require_key=<boolean>"
245 Require the client to provide the key to open a file even if the key is
246 cached. The default is \fIfalse\fP.
248 .SH PINENTRY
250 When \fIenable_pinentry\fP is \fBtrue\fP, commands that require a key
251 will use
252 .BR pinentry (1)
253 to retrieve the passphrase. Since \fBpwmd\fP is a daemon process, it isn't
254 attached to any terminal. So \fBpinentry\fP needs to know where to put it's
255 dialog box by using command line options when executed. These can be set by
256 either using protocol commands (see COMMANDS included in the archive) or by
257 creating a file \fI~/.pwmd/pinentry.conf\fP. When using the file, each line
258 should contain NAME=VALUE pairs where NAME is one of:
260 .B TTYNAME
261 The full path of the tty device.
263 .B TTYTYPE
264 The terminal type (i.e., vt100). Should be set when \fBTTYNAME\fP is set.
266 .B DISPLAY
267 If using an X11 pinentry.
269 .B LC_CTYPE
270 For internationalization.
272 .B LC_MESSAGES
273 For internationalization.
275 .B PATH
276 The full path to the pinentry binary. The default is \fI@pinentry@\fP.
278 The file is read only once after each client first connects. Note that if your
279 not using a \fBDISPLAY\fP, then both \fBTTYNAME\fP and \fBTTYTYPE\fP should be
280 set otherwise you'll get a segfault from ncurses.
282 .SH TCP SUPPORT
283 When compiled with TCP support and \fIenable_tcp\fP is \fItrue\fP, \fBpwmd\fP
284 can accept connections from remote hosts. Authentication is done with X509
285 certificates. The server certificate (\fB~/.pwmd/server-cert.pem\fP) should be
286 signed by a Certificate Authority (CA), which will probably be a locally
287 generated one (see the
288 .BR certtool (1)
289 documentation for how to do this). When a client connects, \fBpwmd\fP
290 will require the client to send a certificate that was signed by the same
291 CA that was used to sign the \fBpwmd\fP server certificate
292 (\fB~/.pwmd/ca-cert.pem\fP). After the client certificate is validated,
293 \fBpwmd\fP will accept commands from the client.
295 .SH SIGNALS
297 .B SIGUSR1
298 Clears the entire file cache. If there are any clients connected, a key will
299 be required for the next \fBOPEN\fP or \fBSAVE\fP command.
301 .B SIGHUP
302 Reloads the configuration file.
304 .B SIGTERM and SIGINT
305 Disallows new connections and waits for all clients to disconnect before
306 terminating.
308 .SH FILES
310 .B ~/.pwmd/config
311 Default configuration file.
313 .B ~/.pwmd/data
314 Default data directory.
316 .B ~/.pwmd/socket
317 Default listening socket.
319 .B ~/.pwmd/log
320 Default log file when logging is enabled.
322 .B @pinentry@
323 Default location of the pinentry binary.
325 .B ~/.pwmd/pinentry.conf
326 Default pinentry settings for new clients.
328 .B ~/.pwmd/ca-cert.pem
329 The certificate authority (CA) than was used to sign the server (and client)
330 certificate.
332 .B ~/.pwmd/server-cert.pem
333 The pwmd server certificate. This is sent to the client. Clients should check
334 the validity of it to ensure that the \fBpwmd\fP server hasn't been hijacked.
336 .B ~/.pwmd/server-key.pem
337 The key that was used to sign the server certificate.
339 .SH AUTHOR
340 Ben Kibbey <bjk@luxsci.net>
342 .URL "http://bjk.sourceforge.net/pwmd/" "PWMD Homepage" .
344 .SH "SEE ALSO"
345 .BR certtool (1),
346 .BR pinentry (1)
348 Also see \fBCOMMANDS\fP included in the archive for protocol commands and
349 syntax.