cf8a8d6ee1756c879bc3f269a0bb2705cfd6eddf
[monkeysphere.git] / doc / README
1 Monkeysphere User README
2 ========================
3
4 You don't have to be an OpenSSH or OpenPGP expert to use the
5 Monkeysphere. However, you should be comfortable using secure shell and
6 you should already have GnuPG installed and an OpenPGP key pair before
7 you begin.
8
9 As a regular user on a system where the monkeysphere package is
10 installed, you probably want to do a few things:
11
12 Keeping your keyring up-to-date
13 -------------------------------
14
15 Regularly refresh your GnuPG keyring from the keyservers.  This can be
16 done with a simple cronjob.  An example of crontab line to do this is:
17
18 0 12 * * * /usr/bin/gpg --refresh-keys > /dev/null 2>&1
19
20 This would refresh your keychain every day at noon.
21
22
23 Keeping your known_hosts file in sync with your keyring
24 -------------------------------------------------------
25
26 With your keyring updated, you want to make sure that OpenSSH can
27 still see the most recent trusted information about who the various
28 hosts are.  This can be done with the monkeysphere-ssh-proxycommand
29 (see next section) or with the update-known_hosts command:
30
31 $ monkeysphere update-known_hosts
32
33 This command will check to see if there is an OpenPGP key for
34 each (non-hashed) host listed in the known_hosts file, and then add
35 the key for that host to the known_hosts file if one is found.  This
36 command could be added to a crontab as well, if desired.
37
38
39 Using monkeysphere-ssh-proxycommand(1)
40 --------------------------------------
41
42 The best way to handle host keys is to use the monkeysphere ssh proxy
43 command.  This command will make sure the known_hosts file is
44 up-to-date for the host you are connecting to with ssh.  The best way
45 to integrate this is to add the following line to the "Host *" section
46 of your ~/.ssh/config file:
47
48 ProxyCommand monkeysphere-ssh-proxycommand %h %p
49
50 The "Host *" section specifies what ssh options to use for all
51 connections. If you don't already have a "Host *" line, you can add it
52 by entering:
53
54 Host *
55
56 On a line by itself. Add the ProxyCommand line just below it.
57
58 Once you've completed this step - you are half-way there. You will now
59 be able to verify servers participating in the monkeysphere provided
60 their keys have been signed by someone that you trust.
61
62 FIXME: We should setup a way for someone to download a test gpg key and
63 then connect to a test server that is signed by this gpg key so users
64 can establish that they are setup correctly.
65
66 The remaining steps will complete the second half: allow servers to
67 verify you based on your OpenPGP key.
68
69 Setting up an OpenPGP authentication key
70 ----------------------------------------
71
72 First things first: you'll need to create a new subkey for your
73 current key, if you don't already have one.  If your OpenPGP key is
74 keyid $GPGID, you can set up such a subkey relatively easily with:
75
76 $ monkeysphere gen-subkey $GPGID
77
78 Typically, you can find out what your keyid is by running:
79
80 gpg --list-secret-keys
81
82 The first line (starting with sec) will include your key length followed
83 by the type of key (e.g. 1024D) followed by a slash and then your keyid.
84
85 Using your OpenPGP authentication key for SSH
86 ---------------------------------------------
87
88 Once you have created an OpenPGP authentication key, you will need to
89 feed it to your ssh agent.
90
91 Currently (2008-08-23), gnutls does not support this operation. In order
92 to take this step, you will need to upgrade to a patched version of
93 gnutls. You can easily upgrade a Debian system by adding the following
94 to /etc/apt/sources.list.d/monkeysphere.list:
95
96                 deb http://monkeysphere.info/debian experimental gnutls
97                 deb-src http://monkeysphere.info/debian experimental gnutls
98
99 And then adding the following to /etc/apt/preferences:
100
101                 Package: libgnutls26
102                 Pin: release o=The MonkeySphere Project
103                 Pin-Priority: 990
104
105                 Package: libgnutls26-dbg
106                 Pin: release o=The MonkeySphere Project
107                 Pin-Priority: 990
108
109                 Package: gnutls-bin
110                 Pin: release o=The MonkeySphere Project
111                 Pin-Priority: 990
112
113                 Package: gnutls-doc
114                 Pin: release o=The MonkeySphere Project
115                 Pin-Priority: 990
116
117                 Package: guile-gnutls
118                 Pin: release o=The MonkeySphere Project
119                 Pin-Priority: 990
120
121                 Package: gnutls-dev
122                 Pin: release o=The MonkeySphere Project
123                 Pin-Priority: 990
124
125 Next, run `aptitude update; aptitude install libgnuttls26`.
126
127 With the patched gnutls installed, you can feed your authentication sub
128 key to your ssh agent by running:
129
130                 monkeysphere subkey-to-ssh-agent
131
132 You may want to add this command to your ~/.xsession file so it is run
133 automatically everytime you login.
134
135 FIXME: using the key with a single session?
136
137 Miscellaneous
138 -------------
139
140 Users can also maintain their own authorized_keys files, for users
141 that would be logging into their accounts.  This is primarily useful
142 for accounts on hosts that are not already systematically using the
143 monkeysphere for user authentication.  If you're not sure whether this
144 is the case for your host, ask your system administrator.
145
146 If you want to do this as a regular user, use the
147 update-authorized_keys command:
148
149 $ monkeysphere update-authorized_keys
150
151 This command will take all the user IDs listed in the
152 ~/.config/monkeysphere/authorized_user_ids file and check to see if
153 there are acceptable keys for those user IDs available.  If so, they
154 will be added to the ~/.ssh/authorized_keys file.
155
156 You must have indicated reasonable ownertrust in some key for this
157 account, or no keys will be found with trusted certification paths.
158
159 If you find this useful, you might want to place a job like this in
160 your crontab so that revocations and rekeyings can take place
161 automatically.