Merge remote-tracking branch 'srht/master'
[worg.git] / worg-git-ssh-key.org
blob0fe535395a16753e67a13e9e19cac9311a66f91c
1 #+TITLE:      Creating a SSH-key for a new user
2 #+AUTHOR:     Worg people
3 #+EMAIL:      mdl AT imapmail DOT org
4 #+STARTUP:    align fold nodlcheck hidestars oddeven lognotestate
5 #+SEQ_TODO:   TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
6 #+TAGS:       Write(w) Update(u) Fix(f) Check(c)
7 #+LANGUAGE:   en
8 #+PRIORITIES: A C B
9 #+CATEGORY:   worg
10 #+OPTIONS:    H:3 num:nil toc:t \n:nil ::t |:t ^:nil -:t f:t *:t d:(HIDE) tags:not-in-toc
11 #+HTML_LINK_UP:    index.html
12 #+HTML_LINK_HOME:  https://orgmode.org/worg/
14 # This file is released by its authors and contributors under the GNU
15 # Free Documentation license v1.3 or later, code examples are released
16 # under the GNU General Public License v3 or later.
18 To push commits to the Worg repository at https://git.sr.ht/~bzg/worg
19 you need to have a SSH key. What's that and how can you create one?
21 * Public and private keys
23 #+index: Public key
24 #+index: Private key
26 A /public key/ is like a door lock, and a /private key/ is like the key.
27 =sr.ht= is asking you for the /public key/, that means, they ask you to
28 provide a lock, and they will install your lock in their server.
29 Then, with your /private key/ you will be able to open a connection to
30 the server.
32 Your /private key/ may be easy to use: just /have it/, and you can use it
33 to open the lock.
35 But suppose you lose it; then it's not secure anymore; any person
36 which has the key (which is a file) can connect to the server
37 supplanting your identity.
39 Therefore, at the computer we do that the /private key/ has a /password/
40 (also called "passphrase"). Then, you do not only need to possess the
41 key to open the lock; you also need to know how to use it (that means,
42 you must have the /public key/ *and* know the password).
44 So: *use a passphrase* for more security.
46 * Steps to create your private and public keys
48 #+index: ssh-keygen
50 1. Run =ssh-keygen= with no parameters. If you want to change the
51    encryption algorithm used, see [[RSA or DSA?][the section below]].
53 2. /Location of the key/: just press enter
55 3. /Passphrase of the key/: enter your new password; the one you will
56    type each time to be able to connect. You can have no password at
57    all, but it's not recommended; read the description at the
58    introduction to know why.
60 4. Now you have 2 new files:
62  - =id_rsa=: that's your new private key. Don't share it!
64  - =id_rsa.pub=: that's your new /public key/. You can distribute it.
66  - You will also see a /fingerprint/ (like =31:c0:5a:92:70:5e:91=... etc).
68 5. Look at the public key. If you don't like the user name which appears
69    at the end, re-run =ssh-keygen -C "comment that you want" =
71 * RSA or DSA?
73 #+index: RSA
74 #+index: DSA
76 You can decide if at the key creation you want to use the algorithm RSA or
77 the algorithm DSA.
79 If you know which one you like, you're lucky; use it!
81 If not, decide one; both will work.
83 By default, =ssh-keygen= uses RSA, but you can use =ssh-keygen -t dsa= to
84 use DSA.