Sida Loo Maareeyo xisaabaadka badan ee GitHub isla Mashiinka

Hadaan nahay horumariyayaal waxaan caadi ahaan ku qasbanaaneynaa inaan kuwareegno akoono badan oo GitHub isla mashiinka ah. Tusaale ahaan waxaan u haynaa koontadayada 'GitHub' shaqsiyadeed oo u gaar ah mashruuc noo gaar ah ka dibna koonto kale oo GitHub ah oo aan u adeegsano mashruuca macmiilkayaga.

Maqaalkani wuxuu bixinayaa tilmaamo tallaabo-tallaabo ah oo ku saabsan sida loo dejiyo oo loola shaqeeyo xisaab badan oo GitHub isla mashiinka ah.

Maamul Xisaabaadyo badan oo GitHub ah

Xaaladdan dhexdeeda waxaan ku abuuri doonnaa laba koonto oo GitHub oo kala duwan isla mashiinka ka dibna aan u kala beddeleyno labada.

Abuur Furayaasha SSH

Marka hore, waxaan u baahanahay inaan u abuurno furayaashayada gaarka loo leeyahay / kuwa gaarka loo leeyahay ee SSH shaqsiyeed koontada

Waxaan tan ku samayn karnaa annagoo ku fulinayna amarka soo socda terminal:

$ ssh-keygen -t rsa -C 'email@gmail.com' -f 'id_rsa_personal'

Cinwaanka emaylka kor ku xusan waa midka aad u isticmaasho inaad ku gasho koontadaada GitHub shaqsiyeed.



Markii lagu weydiiyo goobta si aad u keydiso furayaasha, aqbal meesha caadiga ah adoo riixaya gala. Lammaane furaha gaarka loo leeyahay / dadweynaha ayaa laga sameeyay goobta ssh ee loogu talagay ~/.ssh/.

Furayaasheena gaarka ah ee SSH waa:

~/.ssh/id_rsa_personal.pub iyo ~/.ssh/id_rsa_personal

Marka xigta, waxaan u abuureynaa furayaasheena gaarka loo leeyahay / gaarka ah ee SSH macmiil koontada:

$ ssh-keygen -t rsa -C 'email@company.com' -f 'id_rsa_company'

Cinwaanka emaylka kor ku xusan waa midka aad u isticmaasho inaad ku gasho koontadaada macmiilka GitHub.

Amarka kor ku xusan wuxuu abuuraa furaha macaamiisheena SSH oo ku yaal ~/.ssh/.

Furayaashayada SSH ee furaha u ah waa:

~/.ssh/id_rsa_company.pub iyo ~/.ssh/id_rsa_company

Kudar Fureyaasha SSH si aad u tixgeliso Xisaabaadka GitHub

Soo gal koontadaada 'GitHub' ee gaarka ah kuna dar id_rsa_personal.pub fure dadweynaha

Marka xigta, soo gal koontadaada macmiilka GitHub oo kugu dar id_rsa_company.pub furaha dadweynaha.

Haddii aadan hubin sida loo sameeyo tan, ka dib akhri rakibi Git iyo Abuur Furayaasha SSH .

Cusboonaysii Faylka isku xidhka SSH

Faylka isku xidhka SSH wuxuu deganyahay ~/.ssh/. Haddii aadan arkin faylka isku xirka, ka dibna abuuro mid:

$ cd ~/.ssh/ $ touch config

// Creates the file if not exists $ nano config

// Opens the file for editing

Kudar astaamahaaga kala duwan ee GitHub feylka qaabeynta SSH:

# Personal account Host github.com-personal HostName github.com User git IdentityFile ~/.ssh/id_rsa_personal # Company account-1 Host github.com-company HostName github.com User git IdentityFile ~/.ssh/id_rsa_company

Ka diiwaangeli furayaasha SSH wakiilka ssh

Ku bilow wakiilkaaga ssh adigoo ordaya eval '$(ssh-agent -s)'.

Kadib ku dar furahaaga SSH wakiilka ssh:

ssh-add ~/.ssh/id_rsa_personal ssh-add ~/.ssh/id_rsa_company

Tani waxay ka diiwaangelin doontaa furayaashaaga SSH ssh-wakiilka mashiinka ku jira.

Kaliya Hal Fure SSH oo Firfircoon oo kujira ssh-agent markiiba

Hadda oo aan u abuurnay furayaasheena SSH shaqsi ahaan iyo shirkad ahaaneed oo aan ka diiwaangelinnay wakiilka ssh-ka, waxaan hadda si fudud ugu kala beddeli karnaa labada xisaabood ee GitHub isla mashiinka.

Waxaan u baahannahay inaan hubinno inaan haysano kaliya furaha SSH ee lagu daro wakiilka ssh markiiba.

Tusaale ahaan, haddii aan ka shaqeyneyno mashruuceena gaarka ah waxaan sameynaa:

$ ssh-add -D

//removes all ssh entries from the ssh-agent $ ssh-add ~/.ssh/id_rsa_personal
// Adds the personal ssh key

Sidoo kale, haddii aan ka shaqeyneyno mashruuca macmiilkayaga, waxaan sameynaa:

$ ssh-add -D

//removes all ssh entries from the ssh-agent $ ssh-add ~/.ssh/id_rsa_company

// Adds the company ssh key

Tanina waa sida aan ugu maamuli karno xisaabaadyo badan oo GitHub isla mashiinka ah isla markaana aan u kala beddeleyno iyaga oo ka shaqeynaya mashaariic kala duwan.