Version 2.14.
[pwmd.git] / doc / pwmd.1.in
blobe7bea76f69289407b83a454d5251db69c534741d
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 "8 Feb 2010" "Password Manager Daemon" "Password Manager Daemon"
19 .SH NAME
21 pwmd \- a universal data server
22 .SH SYNOPSIS
23 .B pwmd
24 [options] [file1] [...]
26 .SH DESCRIPTION
27 .B pwmd
28 is a daemon/server that serves clients data which is stored in an, optionally
29 encrypted and compressed, XML data file. Clients connect and send commands
30 that either retrieve or store data.
32 .SH OPTIONS
33 The following are the available command line options. Remaining arguments are
34 files to add to the cache on startup.
35 .TP
36 .I "\-\-rcfile, \-f rcfile"
37 Specify an alternate configuration file. The default is \fB~/.pwmd/config\fR.
39 .TP
40 .I "\-\-import, \-I filename \-\-outfile 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 \fBiterations\fP configuration
44 parameter or the \fI\-\-iterations\fP command line switch), you will be
45 prompted for a passphrase to encrypt with. The output is written to the
46 filename specified with the \fI\-\-outfile\fP command line switch which should
47 then be placed in the configured \fBdata_directory\fP.
49 .TP
50 .I "\-\-iterations, \-i iterations
51 The number of encryption iterations to use when importing. When not specified,
52 the \fBiterations\fP configuration option from the \fBglobal\fP section will
53 be used.
55 .TP
56 .I "\-\-key\-file, \-k keyfile"
57 When importing (\fI\-\-import\fP) or converting (\fI\-\-convert\fP), obtain
58 the key from the specified filename. Be sure to set \fBkey_file\fP in your
59 configuration.
61 .TP
62 .I "\-\-convert, \-C filename \-\-outfile filename"
63 Converts a \fBpwmd\fP version 1 data file to a version 2 data file. If
64 encrypted, you will be prompted for a passphrase to use for decryption (unless
65 using a \fI\-\-key-file\fP). The converted data file will be saved to the
66 filename specified with the \fI\-\-outfile\fP command line switch and with the
67 same passphrase and iterations as the version 1 data file.
69 .TP
70 .I "\-\-disable\-dump, \-D"
71 Disable the XPATH, LIST and DUMP protocol commands. This overrides any
72 \fBdisable_list_and_dump\fP configuration parameter.
74 .TP
75 .I "\-\-no\-fork, \-n"
76 Run as a foreground process.
78 .TP
79 .I "\-\-no\-pinentry, \-P"
80 Disable
81 .BR pinentry (1)
82 use overriding any configuration setting.
84 .TP
85 .I "\-\-version"
86 Version information.
88 .TP
89 .I "\-\-help"
90 Help text.
92 .SH CONFIGURATION FILE
93 Blank lines and lines beginning with '#' are ignored. Some options can have
94 data file-specific settings by placing them in a file section. A file section
95 is declared by surrounding the filename with braces (i.e., \fI[filename]\fP).
96 Global options may be specified in a \fI[global]\fP section and are the
97 default options for new or unspecified files. If the first character of a
98 string value is a tilde, it will be expanded to your home directory. First the
99 global options:
101 .I "socket_path=<string>"
102 Listen on the specified socket. The default is \fI~/.pwmd/socket\fR.
105 .I "socket_perms=<integer>"
106 Permissions to set after creating the socket. This will override any
107 .BR umask (2)
108 setting.
111 .I "allowed=<user,@group,...>"
112 A comma separated list of local usernames or group names allowed to connect to
113 the socket. Groups should be prefixed with a '@'. When not specified only the
114 invoking user may connect. The username is obtained via SO_PEERCRED.
117 .I "data_directory=<string>"
118 Where
119 .B pwmd
120 should store and retrieve data files. The default is \fI~/.pwmd/data\fR.
123 .I "disable_mlockall=<boolean>"
124 When set to \fBfalse\fP,
125 .BR mlockall (2)
126 will be called after the client connects. This will use more physical memory
127 but may also be more secure. Most will probably find it overkill since the
128 contents of all allocated memory is cleared before being freed. Note that this
129 doesn't affect the file cache which is always stored in RAM (if possible).
132 .I "log_path=<string>"
133 Logs informational messages to the specified file. The default is
134 \fI~/.pwmd/log\fR.
137 .I "enable_logging=<boolean>"
138 Enable or disable logging to \fIlog_path\fR. The default is \fBfalse\fR.
141 .I "syslog=<boolean>"
142 Enable logging to
143 .BR syslog (8)
144 with facility LOG_DAEMON and priority LOG_INFO. The default is \fBfalse\fR.
147 .I "log_level=<integer>"
148 The logging level. When \fB0\fP, only connections and errors are logged. When
149 \fB1\fP, client commands are also logged. When \fB2\fP, the command arguments
150 are also logged. The default is \fB0\fP.
153 .I "debug_file=<string>"
154 When set, enable protocol debugging to the specified file. Note that this
155 logs all protocol IO so it may also log sensitive data.
158 .I "disable_list_and_dump=<boolean>"
159 When \fBtrue\fP, the \fBXPATH\fP, \fBLIST\fP and \fBDUMP\fP protocol commands
160 will be disabled and will return an error code.
163 .I "cache_push=<list>"
164 A list of filenames separated with commas that will be pushed into the file
165 cache upon startup.
166 .B pwmd
167 will prompt for the key for each file specified unless the key was specified
168 with the \fIkey\fR or \fIkey_file\fR parameters in a matching file section.
169 The default is none.
172 .I "priority=<integer>"
173 The priority, or niceness, of the server. The default is inherited from the
174 parent process.
177 Below are options that can be specified in the \fB[global]\fP or
178 \fB[filename]\fP section. If in both then \fB[filename]\fP will have
179 precedence.
181 .I "backup=<boolean>"
182 Whether to create a backup of the data file when saving. The default is
183 \fBtrue\fP. The backup filename has the .backup extension appended to the
184 opened file.
187 .I "cache_timeout=<integer>"
188 The number of seconds to keep the cache entry for this file. If \fB-1\fP, the
189 cache entry is kept forever. If \fB0\fP, each time the file is opened (if
190 encrypted) or saved a key will be required.
193 .I "enable_pinentry=<boolean>"
194 If \fBfalse\fP, disable the use of
195 .BR pinentry (1).
196 When disabled and a file requires a passphrase, the passphrase must be
197 included in the command (see COMMANDS included in the archive). The default is
198 \fBtrue\fP. Also see \fBPINENTRY\fP below.
201 .I "pinentry_path=<string>"
202 The full path of the pinentry binary. The default is specified at compile
203 time.
206 .I "pinentry_timeout=<integer>"
207 The number of seconds before the pinentry dialog will terminate while waiting
208 for a passphrase. The default is \fB20\fP. Set to \fB0\fP to wait forever.
211 .I "iterations=<integer>"
212 The number of times to encrypt the data. A value of 10000 or more will make
213 dictionary attacks very slow depending on the CPU and size of the data file.
214 The default is \fB1\fP iteration. Setting to \fB0\fP will disable encryption.
217 .I "cipher=<string>"
218 The default cipher to use when saving a data file. Valid values are:
219 \fBaes128\fP, \fBaes192\fP, \fBaes256\fP, \fBserpent128\fP, \fBserpent192\fP,
220 \fBserpent256\fP, \fBcamellia128\fP, \fBcamellia192\fP, \fBcamellia256\fP,
221 \fB3des\fP, \fBcast5\fP, \fBblowfish\fP, \fBtwofish128\fP and
222 \fBtwofish256\fP. The default is \fBaes256\fP.
225 .I "iteration_progress=<integer>"
226 After the specified number of iterations have been processed while encrypting
227 or decrypting, a status message with the keyword \fBPROGRESS\fP will be sent
228 to the client.  Setting to \fB0\fP, the default, disables sending these
229 progress messages.
232 .I "xfer_progress=<integer>"
233 Commands that send data lines to the client can send the XFER status message
234 after the specified number of bytes have been sent. The number of bytes is
235 rounded to ASSUAN_LINELENGTH (1002).
238 .I "key=<string>"
239 The initial passphrase to use for this file. If specified in the
240 \fBglobal\fP section then "\fBglobal\fP" is treated as a data filename and
241 not a default for other files. Note that if a client changes the passphrase
242 for this data file with the \fBSAVE\fP command, then this value is not
243 modified and will need to be updated by hand.
246 .I "key_file=<string>"
247 Same as the \fBkey\fP option above but obtains the key from the specified
248 filename. Note that if the cache entry for this file gets removed then the
249 only way to add it again is to restart \fBpwmd\fP or to re-read the
250 configuration file (i.e., you won't be prompted from pinentry).
252 Starting with pwmd version 2.14 the entire file is treated as the passphrase
253 including null bytes and newlines. A log message will be displayed warning
254 of the byte position that the key file of previous versions will be truncated
255 to, if any. This message means that the byte position is really the length or
256 size of the key data which may not be the size of the key file. A fix for this
257 is to generate a new key file and \fBimport\fP your data that was exported via
258 the \fBDUMP\fP command with the new key file.
261 .I "compression_level=<integer>"
262 The default compression level for data files from \fB1\fP to \fB9\fP, \fB1\fP
263 being the fastest but least compression and \fB9\fP being the slowest but best
264 compression. To disable compression entirely, set to \fB0\fP. The default is
265 \fB6\fP.
268 .I "zlib_bufsize=<integer>"
269 The input and output buffer size when compressing and decompressing. This
270 affects how often the COMPRESS and DECOMPRESS status messages are sent and
271 also affects compression quality. The default is \fB65536\fP. Set to a higher
272 value for larger files.
275 .I "recursion_depth=<integer>"
276 The maximum number of times to resolve a target attribute for a single element
277 in an element path. An error is returned when this value is exceeded. The
278 default is \fB20\fP but can be disabled by setting to \fB0\fP.
281 .I "keepalive=<integer>"
282 Sends keep alive status messages to the client every N seconds. Set to \fB0\fP
283 to disable. The default is \fB0\fP.
285 .SH PINENTRY
287 When \fBenable_pinentry\fP is \fBtrue\fP, commands that require a key
288 will use
289 .BR pinentry (1)
290 to retrieve the passphrase. Since \fBpwmd\fP is normally a daemon process, it
291 isn't attached to any terminal. So \fBpinentry\fP needs to know where to put
292 it's dialog box by using command line options when executed. These can be set
293 by either using protocol commands (see COMMANDS included in the archive) or by
294 creating a file \fI~/.pwmd/pinentry.conf\fP. When using this file, each line
295 should contain NAME=VALUE pairs where NAME is one of:
297 .B TTYNAME
298 The full path of the tty device.
301 .B TTYTYPE
302 The terminal type (i.e., vt100). Must be set when \fBTTYNAME\fP is set.
305 .B DISPLAY
306 If using an X11 pinentry.
309 .B LC_CTYPE
310 For internationalization.
313 .B LC_MESSAGES
314 For internationalization.
317 .B PATH
318 The full path to the pinentry binary. The default is \fI@pinentry@\fP.
321 The file is read only once after each client first connects. Note that if your
322 not using a \fBDISPLAY\fP, then both \fBTTYNAME\fP and \fBTTYTYPE\fP should be
323 set otherwise you'll get a segfault from ncurses.
325 .SH SIGNALS
327 .B SIGUSR1
328 Clears the entire file cache. If there are any clients connected, a key will
329 be required for the next \fBOPEN\fP or \fBSAVE\fP command.
331 .B SIGHUP
332 Reloads the configuration file.
334 .B SIGTERM and SIGINT
335 Disallows new connections and waits for all clients to disconnect before
336 terminating.
338 .SH FILES
340 .B ~/.pwmd/config
341 Default configuration file.
343 .B ~/.pwmd/data
344 Default data directory.
346 .B ~/.pwmd/socket
347 Default listening socket.
349 .B ~/.pwmd/log
350 Default log file when logging is enabled.
352 .B @pinentry@
353 Default location of the pinentry binary.
355 .B ~/.pwmd/pinentry.conf
356 Default pinentry settings for new clients.
358 .SH AUTHOR
359 Ben Kibbey <bjk@luxsci.net>
361 .URL "http://bjk.sourceforge.net/pwmd/" "PWMD Homepage" .
363 .SH "SEE ALSO"
364 .BR pinentry (1)
366 Also see \fBCOMMANDS\fP included in the archive for protocol commands and
367 syntax.