-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathgenerating-ssh-key.asc
82 lines (74 loc) · 4.47 KB
/
generating-ssh-key.asc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
[[_generate_ssh_key]]
//////////////////////////
=== Generating Your SSH Public Key
//////////////////////////
=== SSH 공개키 만들기
(((SSH keys)))
//////////////////////////
Many Git servers authenticate using SSH public keys.
In order to provide a public key, each user in your system must generate one if they don't already have one.
This process is similar across all operating systems.
First, you should check to make sure you don't already have a key.
By default, a user's SSH keys are stored in that user's `~/.ssh` directory.
You can easily check to see if you have a key already by going to that directory and listing the contents:
//////////////////////////
많은 Git 서버들은 SSH 공개키로 인증한다.
공개키를 사용하려면 일단 공개키를 만들어야 한다.
공개키를 만드는 방법은 모든 운영체제가 비슷하다.
먼저 키가 있는지부터 확인하자.
사용자의 SSH 키들은 기본적으로 사용자의 `~/.ssh` 디렉토리에 저장한다.
그래서 만약 디렉토리의 파일을 살펴보면 이미 공개키가 있는지 확인할 수 있다.
[source,console]
----
$ cd ~/.ssh
$ ls
authorized_keys2 id_dsa known_hosts
config id_dsa.pub
----
//////////////////////////
You're looking for a pair of files named something like `id_dsa` or `id_rsa` and a matching file with a `.pub` extension.
The `.pub` file is your public key, and the other file is your private key.
If you don't have these files (or you don't even have a `.ssh` directory), you can create them by running a program called `ssh-keygen`, which is provided with the SSH package on Linux/Mac systems and comes with Git for Windows:
//////////////////////////
id_dsa나 id_rsa라는 파일 이름이 보일 것이고 이에 같은 파일명의 `.pub` 라는 확장자가 붙은 파일이 하나 더 있을 것이다.
그중 `.pub` 파일이 공개키이고 다른 파일은 개인키다.
만약 이 파일들이 없거나 `.ssh` 디렉토리도 없으면 `ssh-keygen` 이라는 프로그램으로 키를 생성해야 한다. `ssh-keygen` 프로그램은 Linux나 Mac의 SSH 패키지에 포함돼 있고 Windows는 'Git for Windows' 안에 들어 있다.
[source,console]
----
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/schacon/.ssh/id_rsa):
Created directory '/home/schacon/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/schacon/.ssh/id_rsa.
Your public key has been saved in /home/schacon/.ssh/id_rsa.pub.
The key fingerprint is:
d0:82:24:8e:d7:f1:bb:9b:33:53:96:93:49:da:9b:e3 schacon@mylaptop.local
----
//////////////////////////
First it confirms where you want to save the key (`.ssh/id_rsa`), and then it asks twice for a passphrase, which you can leave empty if you don't want to type a password when you use the key.
//////////////////////////
`.ssh/id_rsa` 키를 저장하고 싶은 디렉토리를 입력하고 암호를 두 번 입력한다. 이때 암호를 비워두면 키를 사용할 때 암호를 묻지 않는다.
//////////////////////////
Now, each user that does this has to send their public key to you or whoever is administrating the Git server (assuming you're using an SSH server setup that requires public keys).
All they have to do is copy the contents of the `.pub` file and email it.
The public keys look something like this:
//////////////////////////
다음은 사용자가 자신의 공개키를 Git 서버 관리자에게 보내야 한다.
사용자는 `.pub` 파일의 내용을 복사하여 이메일을 보내기만 하면 된다.
공개키는 아래와 같이 생겼다.
[source,console]
----
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU
GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3
Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA
t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En
mZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx
NrRFi9wrf+M7Q== schacon@mylaptop.local
----
//////////////////////////
For a more in-depth tutorial on creating an SSH key on multiple operating systems, see the GitHub guide on SSH keys at https://help.github.com/articles/generating-ssh-keys[].
//////////////////////////
다른 운영 체제에서 SSH 키를 만드는 방법이 궁금하면 https://help.github.com/articles/generating-ssh-keys[]에 있는 GitHub 설명서를 찾아보는 게 좋다.