1 .\" Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
2 .\" Ben Kibbey <bjk@luxsci.net>
4 .\" This file is part of libpwmd.
6 .\" Libwmd is free software: you can redistribute it and/or modify
7 .\" it under the terms of the GNU General Public License as published by
8 .\" the Free Software Foundation, either version 2 of the License, or
9 .\" (at your option) any later version.
11 .\" Libwmd is distributed in the hope that it will be useful,
12 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
13 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 .\" GNU General Public License for more details.
16 .\" You should have received a copy of the GNU General Public License
17 .\" along with Libpwmd. If not, see <http://www.gnu.org/licenses/>.
19 \\$2 \(laURL: \\$1 \(ra\\$3
21 .if \n[.g] .mso www.tmac
22 .TH PWMD 1 "18 Jun 2012" "Password Manager Client" "Password Manager Client"
25 pwmc \- send a command to a pwmd server
39 A server command is read from standard input and the command result, if any,
40 is sent to either a file descriptor or standard output.
45 A string to parse that can be used for remote pwmd server details rather than
46 the other command line options.
52 Don't lock the data file upon opening it.
55 .I "\--lock-timeout <N>"
56 The time in tenths of a second to wait for another client to release the lock
57 held on a data file before returning an error. When not specified or 0, pwmc
58 will wait indefinately. When -1, an error will be returned immediately.
62 Normally, when the SSH_AUTH_SOCK environment variable is set, pwmc will get
63 authentication details from the ssh agent. When this option is specified or
64 when the environment variable is unset, a private key must be specified on the
71 for how to add a private key to the ssh agent. Note that the
73 command line option has priority over the ssh agent. It is not possible for
76 option to have priority.
79 .I "\--ssh-timeout <seconds>"
80 The number of seconds before a remote command will timeout.
83 .I "\--ssh-keepalive <seconds>"
84 The interval in seconds to send a keepalive message to the remote SSH server.
85 When the keepalive fails the connection will be closed.
88 .I "\--name, -n <string>"
89 Set the client name to the specified string. This string is what shows up in
92 log files. The default is "pwmc".
96 Don't show server status messages. By default, status messages are written to
101 Don't show informational messages. Implies --no-status.
105 Use an interactive pwmc shell. This will let you send more than one command
111 .I "\--inquire <COMMAND>"
112 Use this option to send commands that use a server inquire to retrieve data.
113 Only the command name and any command options should be specified. The
114 command data will be read from the inquire file descriptor or stdin by
118 .I "\--inquire-line, -L <STRING>"
119 The initial line to send during an inquire and before any other data read from
120 the inquire file descriptor. Use this to specify an element path without
121 having to modify the inquire data. See
126 .I "\--inquire-fd <FD>"
129 This option sets the file descriptor to read data from. The default is stdin
134 .I "\-\-inquire-file <filename>"
135 Read the data to send from the specified filename. Also see
139 .I "\--output-fd <FD>"
140 Redirect output to the specified file descriptor. The default is stdout.
143 .I "\--cipher <string>"
144 When saving, encrypt with the specified cipher.
147 .I "\-\-key\-params <string>"
148 When saving, use the specified key parameters rather than pwmds' default. This
149 should be a valid S-expression.
153 After the command has been processed and no error occurred, send the SAVE
154 command to the server.
157 .I "\--key-file <filename>"
158 Read the passphrase from the specified filename.
161 .I "\--s2k-count <N>"
162 The number of passphrase hashing iterations for a new file.
165 .I "\--cipher-iterations <N>"
166 The number of XML encryption iterations. This is really N+1.
170 Disable the use pinentry entirely, both with pwmd and libpwmd.
173 .I "\--pinentry, <path>"
174 The full path to the pinentry binary. The default is the
176 server configured setting.
179 .I "\--ttyname, <path>"
180 The full path of the TTY for
182 to prompt on. The default is the current terminal.
185 .I "\--ttytype, <string>"
186 The terminal type of the specified TTY that
188 should use. This is required if
193 .I "\--display, <string>"
196 should use. Note that a remote SSH
198 is currently not supported. The default is the current DISPLAY if set.
201 .I "\--lc-ctype, <string>"
207 .I "\--lc-messages, <string>"
214 The number of times before failing when an invalid passphrase is entered in
217 dialog. The default is 3.
220 .I "\--timeout, <seconds>"
221 The number of seconds before
223 will timeout while waiting for a passphrase. The default is 30.
226 .I "\--local-pinentry"
227 Force using the local pinentry for passphrase retrieval.
233 but expire any cache entry on the server before saving. When used with
235 the initial passphrase is also cleared.
238 .I "\--ca-cert, <filename>"
239 An X509 certificate authority file to use to validate a TLS server
240 certificate. Required for a TLS connection.
243 .I "\--client-cert, <filename>"
244 An X509 certificate to use for authenticating a TLS connection. Required for a
248 .I "\--client-key, <filename>"
249 An X509 private key to use for decrypting the client certificate when
250 authenticating a TLS connection. Required for a TLS connection.
253 .I "\--tls-priority, <string>"
254 A string representing compression, cipher and hashing algorithm priorities for
255 a TLS connection. See the GnuTLS documentation for details. The default is
260 Verify the TLS server hostname stored in the server certificate against the
261 connected hostname. The default is disabled.
272 In order to get this to work you need to put the following in your
273 .B ~/.ssh/authorized_keys
274 file on the remote SSH host. It should be prepended to the public key that was
277 and specified using the
281 command="socat gopen:$HOME/.pwmd/socket -"
285 command can be replaced with any utility that can read from stdin and write
286 to a local domain socket, and vice-versa.
291 is a program that prompts the user for input of a passphrase. This is
292 currently not supported when connected to a remote pwmd server since X11 port
293 forwarding is not done yet. If a pinentry is required then a local pinentry
296 The terminal, terminal type or DISPLAY that pinentry will prompt on is either
297 set with the command line options or uses options set in
298 .B ~/.pwmd/pinentry.conf
299 when available. Otherwise the current terminal and terminal type or X11
303 .B ~/.pwmd/pinentry.conf
304 file contains one NAME=VALUE pair per line. Comments begin with a '#'.
307 The full path to the location of the pinentry binary.
310 The X11 display to use.
313 The full path to the tty that pinentry should prompt on.
316 The terminal type of the tty (i.e., vt100) which is required if DISPLAY is not
321 Since interactive mode uses the
323 library, the TAB character is normally interpreted as the line completion
324 character. This conflicts with the
326 element separation character. In order to insert a TAB you will first need to
327 press CTRL-V then press TAB. See
329 for more information about line history and completion.
333 To list the available accounts and use
335 to get the passphrase (if required):
337 echo list | pwmc filename
340 To store an element path and save the file afterwards:
342 echo -ne 'isp\\tsmtp\\thostname\\tsomehost.com' | pwmc --inquire STORE -S filename
344 And then to get the content:
346 echo -ne 'get isp\\tsmtp\\thostname' | pwmc filename
351 echo -ne 'some\\telement\\tpath\\t' | cat - data_file | pwmc -S filename --inquire STORE
355 pwmc -S filename --inquire STORE --inquire-line 'some\\telement\\tpath\\t' <
359 Clear the file cache for a single file:
361 echo 'clearcache filename' | pwmc
364 To list root elements of a data file which is stored on a remote pwmd server
365 over an SSH connection:
367 echo list | pwmc --url ssh://user@hostname,~/identity,~/known_hosts filename
370 Start an interactive session over an SSH channel and use the SSH agent to
371 retrieve the private key and save when finished:
373 pwmc --url ssh://user@hostname --use-agent -S filename
376 Connect to a pwmd server over TLS:
378 pwmc --url tls://hostname --ca-cert cafile.pem --client-cert client.pem --client-key clientkey.pem datafile
382 Be careful of newline characters when storing data. The data is transfered and
383 stored exactly as the input is read, newlines and all. If you wonder why your
384 new passphrase for a service doesn't work then a trailing newline character
390 Default socket to connect to.
392 .B ~/.pwmd/pinentry.conf
393 Default settings that
395 will use for the terminal, terminal type or X11 display.
398 Default location of the
403 Ben Kibbey <bjk@luxsci.net>
405 .URL "http://libpwmd.sourceforge.net/" "libpwmd Homepage" .
411 .BR authorized_keys (5),