76eaf8dbd508e66b946cd8e8b66726c90e5d18da
[monkeysphere.git] / man / man1 / monkeysphere.1
1 .TH MONKEYSPHERE "1" "June 2008" "monkeysphere 0.1" "User Commands"
2
3 .SH NAME
4
5 monkeysphere - Monkeysphere client user interface
6
7 .SH SYNOPSIS
8
9 .B monkeysphere \fIsubcommand\fP [\fIargs\fP]
10
11 .SH DESCRIPTION
12
13 \fBMonkeysphere\fP is a framework to leverage the OpenPGP web of trust
14 for OpenSSH authentication.  OpenPGP keys are tracked via GnuPG, and
15 added to the authorized_keys and known_hosts files used by OpenSSH for
16 connection authentication.
17
18 \fBmonkeysphere\fP is the Monkeysphere client utility.
19
20 .SH SUBCOMMANDS
21
22 \fBmonkeysphere\fP takes various subcommands:
23 .TP
24 .B update\-known_hosts [HOST]...
25 Update the known_hosts file.  For each specified host, gpg will be
26 queried for a key associated with the host URI (see HOST
27 IDENTIFICATION in
28 .BR monkeysphere(7)),
29 optionally querying a keyserver.
30 If an acceptable key is found for the host (see KEY ACCEPTABILITY in
31 .BR monkeysphere(7)),
32 the key is added to the user's known_hosts file.  If a key is found
33 but is unacceptable for the host, any matching keys are removed from
34 the user's known_hosts file.  If no gpg key is found for the host,
35 nothing is done.  If no hosts are specified, all hosts listed in the
36 known_hosts file will be processed.  This subcommand will exit with a
37 status of 0 if at least one acceptable key was found for a specified
38 host, 1 if no matching keys were found at all, and 2 if matching keys
39 were found but none were acceptable.  `k' may be used in place of
40 `update\-known_hosts'.
41 .TP
42 .B update\-authorized_keys
43 Update the authorized_keys file for the user executing the command
44 (see MONKEYSPHERE_AUTHORIZED_KEYS in ENVIRONMENT, below).  First all
45 monkeysphere keys are cleared from the authorized_keys file.  Then,
46 for each user ID in the user's authorized_user_ids file, gpg will be
47 queried for keys associated with that user ID, optionally querying a
48 keyserver.  If an acceptable key is found (see KEY ACCEPTABILITY in
49 .BR monkeysphere (7)),
50 the key is added to the user's authorized_keys file.
51 If a key is found but is unacceptable for the user ID, any matching
52 keys are removed from the user's authorized_keys file.  If no gpg key
53 is found for the user ID, nothing is done.  This subcommand will exit
54 with a status of 0 if at least one acceptable key was found for a user
55 ID, 1 if no matching keys were found at all, and 2 if matching keys
56 were found but none were acceptable.  `a' may be used in place of
57 `update\-authorized_keys'.
58 .TP
59 .B gen\-subkey [KEYID]
60 Generate an authentication subkey for a private key in your GnuPG
61 keyring.  KEYID is the key ID for the primary key for which the subkey
62 with "authentication" capability will be generated.  If no key ID is
63 specified, but only one key exists in the secret keyring, that key
64 will be used.  The length of the generated key can be specified with
65 the `\-\-length' or `\-l' option.  `g' may be used in place of
66 `gen\-subkey'.
67 .TP
68 .B ssh\-proxycommand [--no-connect] HOST [PORT]
69 An ssh ProxyCommand that can be used to trigger a monkeysphere update
70 of the ssh known_hosts file for a host that is being connected to with
71 ssh.  This works by updating the known_hosts file for the host first,
72 before an attempted connection to the host is made.  Once the
73 known_hosts file has been updated, a TCP connection to the host is
74 made by exec'ing netcat(1).  Regular ssh communication is then done
75 over this netcat TCP connection (see ProxyCommand in ssh_config(5) for
76 more info).
77
78 This command is meant to be run as the ssh "ProxyCommand".  This can
79 either be done by specifying the proxy command on the command line:
80
81 .B ssh \-o ProxyCommand="monkeysphere ssh\-proxycommand %h %p" ...
82
83 or by adding the following line to your ~/.ssh/config script:
84
85 .B ProxyCommand monkeysphere ssh\-proxycommand %h %p
86
87 The script can easily be incorporated into other ProxyCommand scripts
88 by calling it with the "\-\-no\-connect" option, i.e.:
89
90 .B monkeysphere ssh\-proxycommand \-\-no\-connect "$HOST" "$PORT"
91
92 This will run everything except the final exec of netcat to make the
93 TCP connection to the host.  In this way this command can be added to
94 another proxy command that does other stuff, and then makes the
95 connection to the host itself.
96
97 KEYSERVER CHECKING:
98 The proxy command has a fairly nuanced policy for when keyservers are
99 queried when processing a host.  If the host userID is not found in
100 either the user's keyring or in the known_hosts file, then the
101 keyserver is queried for the host userID.  If the host userID is found
102 in the user's keyring, then the keyserver is not checked.  This
103 assumes that the keyring is kept up-to-date, in a cronjob or the like,
104 so that revocations are properly handled.  If the host userID is not
105 found in the user's keyring, but the host is listed in the known_hosts
106 file, then the keyserver is not checked.  This last policy might
107 change in the future, possibly by adding a deferred check, so that
108 hosts that go from non-monkeysphere-enabled to monkeysphere-enabled
109 will be properly checked.
110
111 Setting the CHECK_KEYSERVER variable in the config file or the
112 MONKEYSPHERE_CHECK_KEYSERVER environment variable to either `true' or
113 `false' will override the keyserver-checking policy defined above and
114 either always or never check the keyserver for host key updates.
115
116 .TP
117 .B subkey\-to\-ssh\-agent [ssh\-add arguments]
118 Push all authentication-capable subkeys in your GnuPG secret keyring
119 into your running ssh-agent.  Additional arguments are passed through
120 to
121 .BR ssh\-add (1).
122 For example, to remove the authentication subkeys, pass an additional
123 `\-d' argument.  To require confirmation on each use of the key, pass
124 `\-c'.  The MONKEYSPHERE_SUBKEYS_FOR_AGENT environment can be used to
125 specify the full fingerprints of specific keys to add to the agent
126 (space separated), instead of adding them all.  `s' may be used in
127 place of `subkey\-to\-ssh\-agent'.
128 .TP
129 .B sshfpr KEYID
130 Output the ssh fingerprint of a key in your gpg keyring. `f' may be
131 used in place of `fingerprint'.
132 .TP
133 .B version
134 Show the monkeysphere version number.  `v' may be used in place of
135 `version'.
136 .TP
137 .B help
138 Output a brief usage summary.  `h' or `?' may be used in place of
139 `help'.
140
141 .SH ENVIRONMENT
142
143 The following environment variables will override those specified in
144 the monkeysphere.conf configuration file (defaults in parentheses):
145 .TP
146 MONKEYSPHERE_LOG_LEVEL
147 Set the log level.  Can be SILENT, ERROR, INFO, VERBOSE, DEBUG,
148 in increasing order of verbosity. (INFO)
149 .TP
150 MONKEYSPHERE_GNUPGHOME, GNUPGHOME
151 GnuPG home directory. (~/.gnupg)
152 .TP
153 MONKEYSPHERE_KEYSERVER
154 OpenPGP keyserver to use. (pool.sks-keyservers.net)
155 .TP
156 MONKEYSPHERE_CHECK_KEYSERVER
157 Whether or not to check keyserver when making gpg queries. (true)
158 .TP
159 MONKEYSPHERE_KNOWN_HOSTS
160 Path to ssh known_hosts file. (~/.ssh/known_hosts)
161 .TP
162 MONKEYSPHERE_HASH_KNOWN_HOSTS
163 Whether or not to hash to the known_hosts file entries. (true)
164 .TP
165 MONKEYSPHERE_AUTHORIZED_KEYS
166 Path to ssh authorized_keys file. (~/.ssh/authorized_keys)
167 .TP
168 MONKEYSPHERE_PROMPT
169 If set to `false', never prompt the user for confirmation. (true)
170 .TP
171 MONKEYSPHERE_STRICT_MODES
172 If set to `false', ignore too-loose permissions on known_hosts,
173 authorized_keys, and authorized_user_ids files.  NOTE: setting this to
174 false may expose you to abuse by other users on the system. (true)
175 .TP
176 MONKEYSPHERE_SUBKEYS_FOR_AGENT
177 A space-separated list of authentication-capable subkeys to add to the
178 ssh agent with subkey-to-ssh-agent.
179
180 .SH FILES
181
182 .TP
183 ~/.monkeysphere/monkeysphere.conf
184 User monkeysphere config file.
185 .TP
186 /etc/monkeysphere/monkeysphere.conf
187 System-wide monkeysphere config file.
188 .TP
189 ~/.monkeysphere/authorized_user_ids
190 A list of OpenPGP user IDs, one per line.  OpenPGP keys with an
191 exactly-matching User ID (calculated valid by the designated identity
192 certifiers), will have any valid authorization-capable keys or subkeys
193 added to the given user's authorized_keys file.
194
195 .SH AUTHOR
196
197 Written by:
198 Jameson Rollins <jrollins@fifthhorseman.net>,
199 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
200
201 .SH SEE ALSO
202
203 .BR monkeysphere\-host (8),
204 .BR monkeysphere\-authentication (8),
205 .BR monkeysphere (7),
206 .BR ssh (1),
207 .BR ssh\-add (1),
208 .BR gpg (1)