Ana amfani da yarjejeniyar SSH don samar da haɗin haɗin haɗi zuwa kwamfuta, wanda ke ba da damar kulawa mai mahimmanci ba kawai ta hanyar tsarin aiki ba, amma ta hanyar hanyar ɓoye. Wani lokaci, masu amfani da tsarin tsarin Ubuntu suna buƙatar shigar da uwar garken SSH akan PC don kowane dalili. Saboda haka, muna ba da shawara mu fahimci wannan tsari daki-daki, bayan munyi nazarin ba kawai hanyar aikawa ba, amma har da maɓallin sigogi na ainihi.
Shigar SSH-uwar garke a Ubuntu
Hakanan kayan SSH suna samuwa don saukewa ta hanyar wurin ajiyar ma'aikata, saboda zamuyi la'akari da irin wannan hanya, shi ne mafi daidaituwa kuma abin dogara, kuma baya haifar da matsala ga masu amfani da novice. Mun karya dukan tsari a cikin matakai domin ya fi sauƙi a gare ku don ku bi umarnin. Bari mu fara daga farkon.
Mataki na 1: Sauke kuma Shigar SSH-uwar garke
Yi aikin zai kasance ta hanyar "Ƙaddara" ta amfani da umarnin babban umurni. Ba lallai ba ne don samun ƙarin ilimin ko kwarewa, za ku sami cikakken bayani game da kowane mataki da dukan umurnai da suka dace.
- Gudura cikin wasan kwaikwayo ta hanyar menu ko rike haɗin Ctrl + Alt T.
- Nan da nan fara fara sauke fayilolin uwar garken daga wurin ajiyar ma'aikata. Don yin wannan, shigar
Sudo apt shigar budessh-uwar garke
sannan kuma danna maballin Shigar. - Tun da mun yi amfani da prefix sudo (yin wani aiki a madadin superuser), kuna buƙatar shigar da kalmar wucewa don asusunku. Lura cewa ba a nuna haruffa a lokacin shigarwa ba.
- Za a sanar da ku game da saukewa na wani adadi na tarihin, tabbatar da aikin ta zaɓin zaɓi D.
- Ta hanyar tsoho, an shigar da abokin ciniki tare da uwar garke, amma ba zai zama mai ban mamaki don tabbatar da cewa yana samuwa ta hanyar ƙoƙarin sake shigar da shi ba
sudo apt-samun shigar openssh-abokin ciniki
.
Za a samo asusun SSH don yin hulɗa tare da shi nan da nan bayan nasarar daɗaɗa duk fayiloli zuwa tsarin aiki, amma dole ne a daidaita shi don tabbatar da aiki daidai. Muna ba da shawara ka fahimtar kanka da matakai na gaba.
Mataki na 2: Duba aikin uwar garke
Da farko, bari mu tabbatar da cewa ana amfani da saitunan daidaitacce, kuma uwar garke na SSH ya amsa ga ka'idoji na ainihi kuma ya aiwatar da su daidai, don haka kuna buƙatar:
- Kaddamar da na'urar bidiyo kuma rijista a can
sudo systemctl dama sshd
, don ƙara uwar garke don farawa Ubuntu, idan ba zato ba tsammani wannan bai faru ba ne bayan an shigarwa. - Idan ba ka buƙatar kayan aiki don farawa tare da OS, cire shi daga izini ta buga
sudo systemctl musayar sshd
. - Yanzu bari mu duba yadda ake yin haɗi zuwa kwamfuta na gida. Aiwatar da umurnin
ssh localhost
(localhost - adireshin kamfaninka na PC). - Tabbatar da ci gaba da haɗin kai ta zabi eh.
- Idan akwai nasarar saukewa, za ka sami wani abu kamar wannan, kamar yadda kake gani a cikin wadannan hotunan. Bincika bukatar buƙata zuwa adireshin
0.0.0.0
, wanda ke aiki a matsayin cibiyar sadarwar IP ta musamman don wasu na'urori. Don yin wannan, shigar da umurnin da ya dace kuma danna kan Shigar. - Tare da kowane sabon haɗi, kuna buƙatar tabbatar da shi.
Kamar yadda kake gani, ana amfani da umurnin ssh don haɗawa da kowane kwamfuta. Idan kana buƙatar haɗi tare da wani na'ura, kawai kaddamar da mota kuma shigar da umurnin a cikin tsarissh sunan mai amfani @ ip_address
.
Mataki na 3: Shirya fayil ɗin sanyi
Duk sauran saitunan don yarjejeniyar SSH an yi ta hanyar tsari na tsari na musamman ta canza ƙwaƙwalwa da dabi'u. Ba za mu mai da hankali kan duk maki ba, kuma mafi yawansu ba su da cikakkiyar mutum ga kowane mai amfani, zamu nuna kawai ayyuka masu girma.
- Da farko, ajiye kwafin ajiya na fayil ɗin sanyi domin samun damarsa ko mayar da asali na SSH a matsayin wani abu. A cikin na'ura wasan bidiyo, shigar da umurnin
Sudo Cp / sauransu / ssh / sshd_config /etc/ssh/sshd_config.original
. - Sa'an nan na biyu:
sudo chmod a-w /etc/ssh/sshd_config.original
. - Gudun fayil ɗin sanyi yana aikata ta
sudo vi / sauransu / ssh / sshd_config
. Nan da nan bayan shigar da shi za a kaddamar kuma za ku ga abubuwan da ke ciki, kamar yadda aka nuna a cikin hotunan da ke ƙasa. - Anan zaka iya canja tashar jiragen da aka yi amfani dashi, wanda shine mafi kyau a yi don tabbatar da tsaro na haɗi, to sai a iya samun shiga a madadin superuser (PermitRootLogin) kuma an kunna maɓallin kunnawa (PubkeyAuthentication). Bayan kammala gyara, latsa maballin : (Shift +; a kan Latin keyboard) kuma ƙara harafin
w
don ajiye canje-canje. - Ana yin fayil din a daidai wannan hanya, kawai a maimakon
w
Ana amfani dashiq
. - Ka tuna da sake farawa da uwar garken ta buga
sudo systemctl sake farawa ssh
. - Bayan canja tashar tashar jiragen ruwa, kana buƙatar gyara shi a cikin abokin ciniki. Anyi wannan ta hanyar tantancewa
ssh -p 2100 localhost
inda 2100 - yawan tashar jiragen ruwa da aka maye gurbin. - Idan kana da tarar tafin wuta, ana bukatar maye gurbin akwai:
sudo ufw ba da damar 2100
. - Za ku sami sanarwar cewa duk an sabunta dokoki.
Kuna da kyauta don sanin kanka da sauran sigogi ta karanta takardun aikin hukuma. Akwai matakai game da canza duk abubuwa don taimakawa wajen ƙayyade dabi'u da ya kamata ka zaɓa.
Mataki na 4: Ƙara Keys
Lokacin daɗa maɓallin SSH, izini zai buɗe tsakanin na'urorin biyu ba tare da buƙatar shigar da kalmar wucewa ba. An sake gina tsarin ƙaddamarwa a ƙarƙashin algorithm na karanta asirin da maɓallin jama'a.
- Bude wani firgita kuma ƙirƙirar sabon maɓallin abokin ciniki ta hanyar bugawa
ssh-keygen -t dsa
sa'an nan kuma sanya sunan zuwa fayil kuma saka kalmar wucewa don samun dama. - Bayan wannan, maɓallin jama'a za a sami ceto kuma za a ƙirƙiri hoton asiri. A allon za ku ga bayyanarsa.
- Ya rage kawai don kwafe fayil ɗin da aka sanya zuwa kwamfuta ta biyu don cire haɗin haɗi ta hanyar kalmar sirri. Yi amfani da umurnin
ssh-copy-id sunan mai amfani @ remotehost
inda sunan mai amfani @ remotehost - sunan kwamfuta mai nisa kuma adireshin IP.
Ya rage kawai don sake farawa uwar garke kuma tabbatar cewa yana aiki daidai ta hanyar maɓallin jama'a da na sirri.
Wannan ya kammala shigarwa na SSH uwar garke da kuma daidaituwa ta asali. Idan ka shigar da dukkan umarnin daidai, babu kurakurai da zai faru a lokacin aiwatar da aikin. Idan akwai wani matsala tare da haɗin bayan kafa, kokarin cire SSH daga farawa don warware matsalar (karanta game da shi a Mataki na 2).