Sanya SSH-sabar a Ubuntu

Pin
Send
Share
Send

Ana amfani da ladabi na SSH don samar da kafaffen haɗi zuwa kwamfuta, wanda ke ba da damar sarrafawa ba kawai ta hanyar harsashi na tsarin aiki ba, har ma ta hanyar hanyar sirri. Wasu lokuta masu amfani da tsarin Ubuntu suna da buƙatar sanya sabar SSH akan PC ɗin su don kowane dalili. Sabili da haka, muna ba da shawara cewa ku fahimci kanku da wannan tsari dalla-dalla, tunda kunyi nazarin ba kawai hanyar saukarwa ba, har ma da saitunan asali.

Sanya SSH-sabar a Ubuntu

Abubuwan haɗin SSH suna samuwa don saukarwa ta wurin wurin ajiya na hukuma, saboda za muyi la’akari da irin wannan hanyar, shine mafi tsayayye kuma abin dogaro, kuma ba ya haifar da matsaloli ga masu amfani da novice. Mun rarrabe tsarin gaba ɗaya zuwa matakai, saboda haka zai zama sauƙi gare ku don bincika umarnin. Bari mu fara daga farkon.

Mataki 1: Saukewa kuma shigar da uwar garken SSH

Zamu gudanar da aikin ta hanyar "Terminal" ta amfani da saiti na asali na umarni. Ba kwa buƙatar samun ƙarin ilimi ko ƙwarewa, zaku sami cikakken bayanin kowane aiki da duk umarnan da suka wajaba.

  1. Unchaddamar da na'ura wasan bidiyo ta menu ko riƙe haɗuwa Ctrl + Alt + T.
  2. Nan da nan fara sauke fayilolin uwar garke daga wurin ajiyar aikin hukuma. Don yin wannan, shigarsudo dace da shigar da openssh-uwar garkensannan danna madannin Shigar.
  3. Tunda muke amfani da kari sudo (aiwatar da aiki a madadin superuser), kuna buƙatar shigar da kalmar sirri don asusunku. Ka lura cewa ba a nuna haruffa yayin shigarwar.
  4. Za a sanar da ku game da saukar da wasu juzu'in kundin tarihin, tabbatar da aikin ta hanyar zaɓi D.
  5. Ta hanyar tsoho, an sanya abokin ciniki tare da sabar, amma ba zai zama superfluous don tabbatar da kasancewar ta ƙoƙarin sake sabunta shi ta amfani dasudo dace-samu kafa openssh-abokin ciniki.

Za a samu uwar garken SSH don yin hulɗa tare da shi nan da nan bayan nasarar da aka samu na duk fayiloli zuwa tsarin aiki, amma har yanzu ana buƙatar tsara shi don tabbatar da aiki daidai. Muna ba da shawarar cewa ku san kanku da waɗannan matakan.

Mataki na 2: Tabbatar da Yin Aiki na Server

Da farko, bari mu tabbatar cewa an yi amfani da sigogin daidai, kuma SSH-uwar garken yana amsa umarni na asali kuma yana aiwatar da su daidai, don haka kuna buƙatar:

  1. Kaddamar da na'ura wasan bidiyo da rubutu a cikisudo systemctl kunna sshddon ƙara sabar zuwa Ubuntu farawa idan wannan bai faru ta atomatik bayan shigarwa.
  2. Idan baku buƙatar kayan aikin don farawa da OS, cire shi daga Autorun ta shigasudo systemctl musaki sshd.
  3. Yanzu bari mu bincika yadda ake yin haɗin haɗin komputa na gida. Aiwatar da umarnissh localhost(localhost adireshin komputa na garinku ne).
  4. Tabbatar da ci gaba da haɗi ta zabi eh.
  5. Game da saukarwar nasara, zaku sami kusan bayanai iri ɗaya kamar yadda kuka gani a cikin allo mai zuwa. Bincika ya zama dole da kuma alaka da adireshin0.0.0.0, wanda yake aiki azaman cibiyar sadarwar tsohuwar IP da aka zaɓa don wasu na'urori. Don yin wannan, shigar da umarnin da ya dace kuma danna Shigar.
  6. Tare da kowane sabon haɗin, zai zama dole a tabbatar da shi.

Kamar yadda kake gani, ana amfani da ssh umarni don haɗawa da kowace kwamfuta. Idan kuna buƙatar haɗawa zuwa wata na'urar, kawai fara tashar tashoshin kuma shigar da umarni a cikin tsarissh sunan mai amfani @ ip_address.

Mataki na 3: Gyara fayil ɗin sanyi

Dukkanin ƙarin saitunan SSH ana aiwatar da su ta hanyar fayil na musamman ta hanyar canza layi da dabi'u. Ba za mu mai da hankali kan duk abubuwan ba, bugu da ,ari ba, mafi yawansu ba su kasance masu zaman kansu keɓaɓɓu ga kowane mai amfani ba, kawai za mu nuna manyan ayyukan.

  1. Da farko dai, adana kwafin ajiya na fayil ɗin sanyi saboda idan wani abu zaka iya samun damar yin amfani da shi ko dawo da matsayin farko na SSH. Manna umarnin a cikin na'ura wasan bidiyosudo cp / sauransu / ssh / sshd_config /etc/ssh/sshd_config.original.
  2. Sai na biyu:sudo chmod a-w /etc/ssh/sshd_config.original.
  3. An ƙaddamar da fayil ɗin saiti ta hanyarsudo vi / sauransu / ssh / sshd_config. Nan da nan bayan shigar da shi, za a ƙaddamar da shi kuma za ku ga abubuwan da ke ciki, kamar yadda aka nuna a cikin allo a ƙasa.
  4. Anan za ku iya canza tashar tashar da aka yi amfani da ita, wanda koyaushe ya fi dacewa don tabbatar da tsaro na haɗin, to za a iya shiga login a madadin mai kulawa (PermitRootLogin) kuma za a iya kunnawa ta maɓallin (PubkeyAuthentication). Bayan an gama gyara, danna maɓallin : (Canji + a layin Latin) kuma ƙara harafinwdomin adana canje-canje.
  5. Fitar fayil ana yi daidai da hanya, amma a maimakon hakawana amfani dashiq.
  6. Ka tuna don sake kunna sabar ta hanyar bugawasudo systemctl sake kunnawa ssh.
  7. Bayan canza tashar tashar aiki, kuna buƙatar gyara shi a cikin abokin ciniki. Anyi wannan ne ta hanyar tantancewassh -p 2100 localhostina 2100 - yawan tashar da aka sauya.
  8. Idan kun saita aikin gidan wuta, kuma yana buƙatar musanyawa:sudo ufw damar 2100.
  9. Kuna karɓar sanarwa cewa an sabunta duk dokoki.

Zaku iya sanin kanku da ragowar sigogi ta hanyar karanta abubuwan aiki. Akwai nasihu don sauya duk abubuwan don taimakawa ƙimar wane ƙimar da ya kamata ka zaɓa da kanka.

Mataki na 4: dingara Maɓallan

Lokacin da aka ƙara maɓallan SSH, izini tsakanin na'urori biyu yana buɗe ba tare da buƙatar kalmar sirri ba. Ana sake gina tsari na ganowa a ƙarƙashin algorithm don karanta asirin da maɓallin jama'a.

  1. Bude na'ura wasan bidiyo kuma ƙirƙiri sabon maɓallin abokin ciniki ta shigassh-keygen -t dsa, sannan sanya suna tare da saka kalmar wucewa don samun dama.
  2. Bayan haka, mabuɗin jama'a zai sami ceto kuma za'a ƙirƙiri hoton sirri. A allon zaka ga kallonta.
  3. Ya rage kawai don kwafa fayil ɗin da aka ƙirƙira zuwa kwamfutar ta biyu don cire haɗin haɗin ta kalmar sirri. Yi amfani da umarnisunan mai amfani ssh-copy-id @ remotehostina sunan mai amfani @ nesahost - Sunan kwamfyutan nesa da adireshin IP.

Ya rage kawai don sake kunna uwar garken da tabbatar da daidai aikin ta cikin maɓallan jama'a da na ɓoye.

Wannan ya kammala shigarwa na uwar garken SSH da tushen saiti. Idan ka shigar da dukkan umarni daidai, babu kurakuran da ya kamata ya faru yayin aikin. Idan akwai matsala ta haɗi bayan saiti, gwada cire SSH daga farawa don magance matsalar (karanta game da shi a ciki Mataki na 2).

Pin
Send
Share
Send