]> sipb.mit.edu Git - wiki.git/blob - doc/root-instance.mdwn
d3bc5eebf96ce6a98a83198d98d46780c63603ea
[wiki.git] / doc / root-instance.mdwn
1 [[!meta title="Root and Extra Instances"]]
2
3 This page explains why you want a *root instance*
4 `joeuser/root@ATHENA.MIT.EDU` and an *extra instance*
5 `joeuser/extra@ATHENA.MIT.EDU`, how to get them, and how to use them
6 well.
7
8 ## Background
9
10 There are three parts of a Kerberos name: a *principal*, an optional
11 *instance*, and a *realm*. The principal is typically your username
12 (for Kerberos identities belonging to a user), and the realm, at MIT,
13 is usually ATHENA.MIT.EDU. (Other realms you may see are
14 CSAIL.MIT.EDU, ZONE.MIT.EDU, CS.CMU.EDU, etc.) For the Kerberos
15 identity you typically regard as your own, the one that you use to log
16 in to Athena with your regular password, the instance is null
17 (empty). However, you can ask for additional instances, usually a
18 "root" or "extra" instance. You can use them in places where you
19 wouldn't want to use your regular Athena password. You usually write a
20 non-null instance as, e.g., `joeuser/root@ATHENA.MIT.EDU`.
21
22 The entire triplet is also often referred to as a principal or
23 instance, depending on context: "There are two Kerberos principals
24 that can log in to this server, namely, my extra instance and my root
25 instance. My null instance can't log in."
26
27 ## Typical use
28
29 Root instances are often used when logging in to servers that have
30 some security import. Most students regularly log in to Athena cluster
31 workstations and quickstations and often type their password on other
32 people's laptops to SSH or get to webmail. This puts the password at
33 huge risk for theft. Athena passwords [have been stolen from clusters
34 in the past](http://tech.mit.edu/V125/PDF/N20.pdf), so it's not the
35 wisest idea to let servers that you're asking hundreds of people to
36 log into and use be controlled by a password you're typing everywhere.
37
38 So you get a root instance, and only type the root instance password
39 on computers you trust and only when you need to. Many people only
40 ever type it on their laptop, or on a freshly booted Live CD. Some
41 people feel comfortable typing it on a few private Athena workstations
42 (SIPB office heads are a common choice), but if an attacker has stolen
43 your regular (null instance) password and installed a keylogger on
44 your account, it doesn't matter where you're logging in if it's still
45 your Athena account.
46
47 You can also make things in Moira or AFS owned by your root instance,
48 if you don't want your null instance to be able to mess with mailing
49 lists or lockers. For Moira, make them owned by
50 `KERBEROS:yourname/root@ATHENA.MIT.EDU`. For AFS, ask accounts or afsreq to get
51 you a 'pts id', basically an account with the AFS servers, and then
52 you can give bits to yourname.root and start blanching your root
53 instance onto AFS groups.
54
55 To use another instance, just specify it to the kinit command, e.g.,
56 `kinit joeuser/root`.
57
58 ## Handy scripts
59
60 Because you would want to use your null instance tickets most of the
61 time but your root instance tickets occasionally, a couple of people
62 have developed shell scripts to make it easy to switch between them.
63
64  * nelhage has the [krbroot
65    command](http://web.mit.edu/nelhage/Public/krbroot), with which you
66    use syntax like "krbroot ssh linerva" when you want to use your
67    root instance for a command. You can also "krbroot shell".
68
69  * quentin and broder wrote [kdo](http://web.mit.edu/snippets/kerberos/kdo),
70    which is similar in spirit to krbroot, but designed for Mac OS
71    X. It takes advantage of the fact that OS X's Kerberos
72    implementation is better at handling multiple tickets.
73
74  * geofft has [kpagsh](http://web.mit.edu/geofft/Public/bashrc.kpagsh),
75    a way of configuring your .bashrc to prompt you for tickets (null
76    instance by default) if you start a shell and don't have
77    tickets. If you want to switch tickets, you start a new shell, and
78    also a new PAG, which lets you use multiple AFS credentials at
79    once, too. It also modifies your prompt.
80
81 These aliases are also careful to get shorter lifetime tickets that
82 are marked nonforwardable. Some versions of SSH try to forward tickets
83 by default. Since you might let your root instance tickets access many
84 servers, but not trust all of these servers equally, you don't want
85 your tickets to be forwardable. (Thankfully, recent Debian, Ubuntu,
86 and OS X have turned off this default, but it's a good precaution.)
87
88 ## Extra instances
89
90 Another thing you might want is an *extra instance*. Some people use
91 these just like another root instance, with slightly lower
92 security. But a common use is something *less* secure than your null
93 instance. For example, if you're writing a zephyrbot to run on a
94 shared server like `scripts.mit.edu`, the zephyrbot will need Kerberos
95 tickets to subscribe to zephyrs. But you don't want to leave your
96 Kerberos password in a file in your locker, so you can leave your
97 extra instance's password instead.
98
99 ## Getting them
100
101 You need to show up in person to [IS&T User
102 Accounts](http://ist.mit.edu/support/accounts) in
103 [E17](http://whereis.mit.edu/?go=E17) during business hours with a
104 photo ID to obtain new Kerberos identities. For the reasons described
105 above, being in control of your null instance and sending a zephyr or
106 authenticated e-mail with it does not mean that you can go ahead and
107 make changes to your root or extra instance too.  While you're there,
108 be sure to ask for a pts id, if you want to use your tickets with AFS.
109
110 ## Upgrading cryptographic strength
111
112 You should change your root instance’s password with a command like this, to upgrade your key from critically weak DES encryption algorithm to strong AES encryption:
113
114     kadmin -p andersk/root -q 'cpw -e aes256-cts:normal -e aes128-cts:normal andersk/root'
115
116 (Note: This might make your password incompatible with a [handful of services](http://debathena.mit.edu/trac/ticket/529) that you should not have been using with your root instance in the first place.)  You can confirm the change with
117
118     kadmin -p andersk/root -q 'getprinc andersk/root'
119
120 which should list a line like
121
122     Key: vno 4, aes256-cts-hmac-sha1-96, no salt
123
124 If you change your password again, you will need to specify your desired enctypes with the -e option; otherwise, they will be reset to the defaults.