Ikani seva ya SSH ku Ubuntu

Pin
Send
Share
Send

Protocol ya SSH imagwiritsidwa ntchito popereka kulumikizidwa kotetezeka ku kompyuta, yomwe imalola kuwongolera kwakanthawi osati kudzera mu chigobacho cha opareting'i sisitimu, komanso kudzera m'njira yolumikizidwa. Nthawi zina ogwiritsa ntchito Ubuntu wogwiritsa ntchito amafunikira kuyika seva ya SSH pa PC yawo pacholinga chilichonse. Chifukwa chake, tikupangira kuti mudziwe bwino za njirayi mwatsatanetsatane, mutangophunzira momwe simutayira, komanso kapangidwe kazigawo zazikulu.

Ikani seva ya SSH ku Ubuntu

Zigawo za SSH zilipo kuti zitha kutsitsidwa kudzera posungira boma, chifukwa tilingalira njira yotere, ndiyokhazikika kwambiri komanso yodalirika, komanso sizibweretsa zovuta kwa ogwiritsa ntchito novice. Tidagawa njira yonse m'magawo, kuti zitheke kusuntha malangizo. Tiyeni tiyambe kuyambira pa chiyambi.

Gawo 1: Tsitsani ndikuyika SSH-seva

Tigwira ntchitoyi kudzera "Pokwelera" kugwiritsa ntchito malamulo oyambira. Simufunikanso kukhala ndi chidziwitso chowonjezera kapena luso, mudzalandira kulongosola mwatsatanetsatane kwa chilichonse chochita komanso malamulo onse ofunikira.

  1. Tsegulani chopereka kudzera pa menyu kapena kugwira chophatikizacho Ctrl + Alt + T.
  2. Nthawi yomweyo yambani kutsitsa mafayilo a seva kuchokera kumalo osungira. Kuti muchite izi, lowetsanisudo apt kukhazikitsa opensh-sevakenako ndikanikizani fungulo Lowani.
  3. Popeza timagwiritsa ntchito prefix wokonda (kuchitapo kanthu m'malo mwa wamkulu), muyenera kuyika akaunti yachinsinsi pa akaunti yanu. Dziwani kuti zilembo sizikuwonetsedwa pakuyika.
  4. Mukudziwitsidwa za kutsitsa kuchuluka kwakale, tsimikizani chochita posankha D.
  5. Pokhapokha, kasitomala amaikidwa ndi seva, koma sizingakhale zowoneka bwino kuti zitsimikizire kupezeka kwake poyesera kuyikansosudo apt-kukhazikitsa opensh-kasitomala.

Seva ya SSH ipezeka kuti izitha kugwira nawo ntchito mukangophatikiza bwino mafayilo onse ku opareting'i sisitimu, komabe ikuyenera kukonzedwa kuti iwonetsetse kuti ikugwira bwino ntchito. Tikukulimbikitsani kuti muzidziwitsa izi:

Gawo 2: Onetsetsani Kuti Mukugwira Ntchito Server

Choyamba, tiwonetsetse kuti magawo onse adagwiritsidwa ntchito molondola, ndipo seva ya SSH imayankha pamalamulo oyambira ndikuwachita molondola, chifukwa chake muyenera:

  1. Tsegulani kutonthoza ndikulemba pameneposudo systemctl imathandizira sshdkuwonjezera seva pa Ubuntu woyambira ngati izi sizingachitike zokha pambuyo pa kukhazikitsa.
  2. Ngati simukufuna chida choti muyambe ndi OS, chotsani pa autorun ndikulowasudo systemctl lemekezani sshd.
  3. Tsopano tiyeni tiwone momwe kulumikizana kumakompyuta apandalo kudapangidwira. Lemberanissh lochost(khalid ndi adilesi ya PC yakwanu).
  4. Tsimikizani kulumikizana kopitilira posankha inde.
  5. Kuti muthe kutsitsa bwino, mudzalandila zambiri zofanana ndi zomwe mukuwona pazithunzithunzi. Chongofunika ndikulumikizana ndi adilesi0.0.0.0, yomwe imagwira ntchito ngati IP yosankhidwa yolumikizidwa ndi IP ya zida zina. Kuti muchite izi, lowetsani lamulo loyenerera ndikudina Lowani.
  6. Ndi kulumikizana kulikonse, ndikofunikira kutsimikizira izi.

Monga mukuwonera, lamulo la ssh limagwiritsidwa ntchito polumikiza kompyuta iliyonse. Ngati mukufuna kulumikizana ndi chipangizo china, ingoyambani terminal ndikulowetsa mtunduwossh username @ ip_address.

Gawo 3: Kusintha fayilo ya kasinthidwe

Zosintha zonse za protocol ya SSH zimachitika kudzera mu fayilo yosinthika mwakusintha mzere ndi mfundo. Sitiyang'ana kwambiri pamfundo zonse, kuwonjezera apo, ambiri aiwo ndi ogwiritsa ntchito aliyense, tizingowonetsa zochita zazikulu.

  1. Choyamba, sungani kopi ya fayilo yokhayo kuti ngati mungathe kuigwiritsa ntchito kapena kubwezeretsa mtundu woyamba wa SSH. Ikani lamulo ku cholumikizirasudo cp / etc / sshd_config /etc/ssh/sshd_config.original.
  2. Kenako yachiwiri:sudo chmod a-w /etc/ssh/sshd_config.original.
  3. Fayilo ya zoikamo imayambitsidwa kudzerasudo vi / etc / ssh / sshd_config. Mukangoilowa, idzakhazikitsidwa ndipo muwona zomwe zili, monga zikuwonekera pachithunzipa.
  4. Apa mutha kusintha doko logwiritsiridwa ntchito, lomwe nthawi zonse limakhala labwino kuonetsetsa kuti chitetezo chikugwirizana, kenako kulowa m'malo mwa superuser (PermitRootLogin) imatha kulemala ndikuyambitsa ndi kiyi (PubkeyAuthentication) ikhoza kuthandizidwa. Mukamaliza kusintha, dinani batani : (Shift + mu chiLatini) ndikuwonjezera kalatayowkusunga zosintha.
  5. Kutuluka fayilo kumachitika chimodzimodzi, koma m'malowimagwiritsidwa ntchitoq.
  6. Kumbukirani kuyambiranso seva polembasudo systemctl kubwezeretsa ssh.
  7. Pambuyo pakusintha doko logwira, muyenera kukonza mu kasitomala. Izi zimachitika pofotokozassh -p 2100 malo okhalapati 2100 - chiwerengero cha doko lomwe lasinthidwa.
  8. Ngati muli ndi makina oyimitsa moto, amafunikiranso m'malo mwake:sudo ufw amalola 2100.
  9. Mudzalandira zidziwitso kuti malamulo onse asinthidwa.

Mutha kuzidziwa bwino magawo ena onse powerenga zolemba zovomerezeka. Pali maupangiri osintha zinthu zonse kuti zithandizire kudziwa zomwe muyenera kusankha nokha.

Gawo 4: Zowonjezera

Makiyi a SSH akawonjezeredwa, chilolezo pakati pa zida ziwiri chimatseguka popanda kufunikira achinsinsi. Njira yodziwitsa imamangidwanso pansi pa algorithm yowerenga chinsinsi komanso chinsinsi cha anthu.

  1. Tsegulani chopondera ndikupanga kiyi yatsopano ya kasitomala polowassh-keygen -t dsa, kenako lembani fayilo ndi kutchula achinsinsi kuti mupeze nawo.
  2. Pambuyo pake, fungulo la anthu lidzapulumutsidwa ndipo chithunzi chobisika chidzapangidwa. Pa zenera muwona mawonekedwe ake.
  3. Zimangoyenera kukopera fayilo yomwe idapangidwa ku kompyuta yachiwiri kuti isakanize kulumikizana kudzera pa password. Gwiritsani ntchito lamulossh-copy-id username @ kutalihostpati username @ kutalihost - dzina la kompyuta yakutali ndi adilesi yake ya IP.

Zimangoyambitsanso seva ndikuwonetsetsa kuti ndi zolondola pakugwira ntchito kudzera pagulu ndi chinsinsi.

Izi zimamaliza kukhazikitsa kwa seva ya SSH ndi kukhazikitsa kwake kofunikira. Ngati muyika malamulo onse moyenera, palibe zolakwika zomwe zimayenera kuchitika panthawi ya ntchitoyo. Pamavuto aliwonse olumikizana mutatha kusinthaku, yesani kuchotsa SSH kuyambira poyambira kuti muthane ndi vutoli (werengani za izo mkati Gawo 2).

Pin
Send
Share
Send