Contents of /xml/htdocs/proj/en/infrastructure/cvs-sshkeys.xml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.3 - (show annotations) (download) (as text)
Thu Jul 5 03:49:56 2007 UTC (10 years, 6 months ago) by kingtaco
Branch: MAIN
Changes since 1.2: +0 -23 lines
File MIME type: application/xml
cleanup for ldap, bug #174005

1 <?xml version='1.0' encoding="UTF-8"?>
2 <?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?>
4 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
6 <guide link = "/proj/en/infrastructure/cvs-sshkeys.xml">
7 <title>SSH access to cvs.gentoo.org</title>
8 <author title="Author">
9 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
10 </author>
11 <abstract>
12 This mini-guide explains on how to create and use ssh-keys, especially
13 for use on cvs.gentoo.org.
14 </abstract>
15 <version>1.0</version>
16 <date>3rd of July, 2003</date>
18 <chapter>
19 <title>SSH keys</title>
20 <section>
21 <title>Creating the SSH keys</title>
22 <body>
23 <p>
24 First of all, be physically logged on to your own computer. Make sure
25 that no-one will see you typing stuff in, since we are going to type in
26 passphrases and such. So get your pepperspray and fight all untrusted
27 entities until you are home alone.
28 </p>
29 <p>
30 Now we are going to create our ssh keys, DSA keys to be exact. Log onto
31 your computer as the user that you are going to be using when you want
32 to access cvs.gentoo.org. Then issue <c>ssh-keygen -t dsa</c>:
33 </p>
34 <pre caption = "Creating SSH keys">
35 $ <i>ssh-keygen -t dsa</i>
36 Generating public/private dsa key pair.
37 Enter file in which to save the key (/home/temp/.ssh/id_dsa): <comment>(Press enter)</comment>
38 Created directory '/home/temp/.ssh'.
39 Enter passphrase (empty for no passphrase): <comment>(Enter your passphrase)</comment>
40 Enter same passphrase again: <comment>(Enter your passphrase again)</comment>
41 Your identification has been saved in /home/temp/.ssh/id_dsa.
42 Your public key has been saved in /home/temp/.ssh/id_dsa.pub.
43 The key fingerprint is:
44 85:35:81:a0:87:56:78:a2:da:53:6c:63:32:d1:34:48 temp@Niandra
45 </pre>
46 <note>
47 Please be sure to set a strong passphrase on your private key. Ideally,
48 this passphrase should be at least 8 characters and contain a mixture of
49 letters, numbers and symbols.
50 </note>
51 <p>
52 Now wasn't that easy? Let's see what we have created:
53 </p>
54 <pre caption = "Created files">
55 # <i>ls ~/.ssh</i>
56 id_dsa id_dsa.pub
57 </pre>
58 <p>
59 You'll probably have more files than this, but the 2 files listed above
60 are the ones that are really important.
61 </p>
62 <p>
63 The first file, <path>id_dsa</path>, is your <e>private</e> key. Don't
64 distribute this amongst all people unless you want to get into a fight
65 with drobbins (no, you don't want that).
66 </p>
67 <warn>
68 If you have several (<e>trusted!</e>) hosts from which you want to
69 connect to cvs.gentoo.org, you should copy <path>id_dsa</path> to the
70 <path>~/.ssh</path> directories on those hosts.
71 </warn>
72 <p>
73 The second file, <path>id_dsa.pub</path>, is your <e>public</e> key.
74 Distribute this file amongst all hosts that you want to be able to
75 access through SSH pubkey authentification. This file should be appended
76 to <path>~/.ssh/authorized_keys</path> on those remote hosts. Also add it
77 to your local host so you can connect to that one too if you have several
78 boxes.
79 </p>
80 <pre caption = "Adding the SSH key to the box">
81 $ <i>cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys</i>
82 </pre>
83 </body>
84 </section>
85 <section>
86 <title>Using keychain</title>
87 <body>
88 <p>
89 Every time you want to log on to a remote host using SSH public key
90 authentification, you will be asked to enter your passphrase. As much as
91 everybody likes typing, too much is sometimes too much. Luckily,
92 there is <c>keychain</c> to the rescue. There is an document on this
93 one <uri link="http://www.gentoo.org/proj/en/keychain.xml">here</uri>,
94 but I'll give you a quick introduction.
95 </p>
96 <p>
97 First, install <c>keychain</c>:
98 </p>
99 <pre caption = "Installing keychain">
100 # <i>emerge keychain</i>
101 </pre>
102 <p>
103 Now have keychain load up your private ssh key when you log on to your
104 local box. To do so, add the following to <path>~/.bash_profile</path>.
105 Again, this should be done on your <e>local</e> machine where you work
106 at the Gentoo CVS.
107 </p>
108 <pre caption = "Add this to .bash_profile">
109 keychain ~/.ssh/id_dsa
110 . .keychain/<comment>hostname</comment>-sh
111 </pre>
112 <p>
113 Be sure to substitute <c>hostname</c> with your hostname.
114 </p>
115 </body>
116 </section>
117 </chapter>
118 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20