forked from progit/progit2-uz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generating-ssh-key.asc
54 lines (46 loc) · 3.1 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
[[_generate_ssh_key]]
=== Sizning SSH ochiq (public) kalitingizni generatsiyalash
(((SSH keys)))
Bu shuni anglatadiki, Git serverlar autentifikatsiyada SSH ochiq kalitlaridan foydalanadi.
Shu sababli har bir foydalanuvchi agar unga ega bo'lmasa o'zi uchun SSH ochiq kalitini generatsiya qilishi kerak.
Ushbu jarayon barcha operatsion tizimlarda bir xil.
Birinchi, yaratishdan avval siz kalitga ega emasligingizni tekshirishingiz kerak.
Odatda o'zgarishlarsiz, foydalanuvchilar kalitlari foydalanuvchilar `~/.ssh` katalogida joylashgan bo'ladi.
Siz onsongina kalit bor yoki yo'qligini ana shu katalogga kirgan holda va faylni tashkil etuvchi qismini tekshirib ko'rishingiz mumkin:
[source,console]
----
$ cd ~/.ssh
$ ls
authorized_keys2 id_dsa known_hosts
config id_dsa.pub
----
Siz ko'rib turganingizdek fayllar `id_dsa` yoki `id_rsa` kabi boshlanuvchi nomlar bilan juftlikni xosil qiladi. Faqat ulardan birini kengaytmasi `.pub` bo'ladi. `.pub` kengaytmali fayl sizning ochiq kalitingiz yonidagisi uning nomdosh sherigi esa yopiq kalit hisoblanadi.
Agar siz bunday fayllarga ega bo'lmasangiz (yoki `.ssh` katalogiga ham ega bo'lmasangiz) `ssh-keygen` programmasi yordamida ularni generatsiya qilishingiz kerak bo'ladi. Ushbu programma Linuxda SSH paketi bilan, Windowsda esa MSysGit paketi bilan birga o'rnatiladi:
[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 [email protected]
----
Bunda birinchi so'ralayotgan narsa kalitni qayerda saqlanishi (`.ssh/id_rsa`) kerakligi va undan keyin kalitni ishlatgan vaqtingizda parolni ishlatishni xohlasangiz uning uchun teriladigan parolni ikki marta terib tasdiqlanishi.
Endi har bir shu ishni qilgan foydalanuvchi qaysi Git serverga shu kalit bilan bog'lanmoqchi bo'lsa uni ana shu Git server adminstratoriga jo'natishi kerak (agarda ana shu Git serverda SSH server o'rnatilgan bo'lsa uni ishlatish mumkin bo'ladi).
Buning uchun sizni qilishingiz kerak bo'lgan ish `.pub` kengaytmali faylni nusxasini olib pochta orqali yuborishdir.
Ochiq kalit quyidagi ko'rinishda bo'lishi mumkin:
[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== [email protected]
----
SSH kalitlarni turli operatsioni tizimlarda yaratish yuzasidan chuqurroq bilim olishni istasangiz, bunga bagʻishlangan githubda joylashgan quyidagi qoʻllanmadan foydalanishingiz mumkin: https://help.github.com/articles/generating-ssh-keys[].