Thumela iphasiwedi ye-SSH kulayini ofanayo nephakethe le-sshpass

Okwalabo abasebenzisa i- ssh, okusho ukuthi, thina esidinga ukufinyelela kumakhompyutha akude noma amaseva njalo osukwini lwethu nosuku, sifinyelela ezingeni lokudinwa ukuthayipha amaphasiwedi, kungaba:

  1. Ukhiye esigungwini: ssh user @ server
  2. Linda imizuzwana embalwa
  3. Iseva lapho sifuna ukuxhuma khona izocela iphasiwedi
  4. Lapho sesibeke iphasiwedi bese sicindezela u- [Enter] sizobe sesingena kwiseva ekude

Futhi manje umbuzo wami, akulula yini ukuthayipha nje?:

sshpass -p «PASSWORD» ssh root@servidor

Isibonelo, ake sithi umsebenzisi izimpande, iseva yile: webmediax.net nephasiwedi ithi okube ... khona-ke umugqa uzoba:

sshpass -p xunil ssh root@dev.desdelinux.net

Ukufeza lokhu kufanele simane sifake iphakheji sshpasse Debian / Ubuntu noma okuphuma kuzoba nakho sudo apt-uthole faka i-sshpass Okwamanje ku I-ArchLinux noma okuphuma kuzonanela I-sudo pacman -S sshpass

Uma sifuna ukucacisa itheku (ngoba i-SSH ayikho ethekwini 22sengeza -p «IPHEPHA» ... okungukuthi, kucatshangwa ukuthi kuyitheku 9122:

sshpass -p xunil ssh root@dev.desdelinux.net -p 9122

Ukwenza lula konke lokhu ngisho nangokwengeziwe singakha izibizoIsibonelo, lapho kwenziwa i-server1, wonke umugqa wenziwa ukuxhuma nge-SSH kuseva1 (sshpass -p iphasiwedi yomsebenzisi @ server1) noma into efanayo, ngakho-ke futhi sigcina ukubeka umugqa omude kakhulu 😉

Noma kunjalo, ngiyethemba lokhu kube wusizo kuwe.

Ngendlela, enye indlela yokugwema ukubhala iphasiwedi lapho sifinyelela nge-SSH ukusebenzisa izinkinobho zomphakathi nezangasese.

Phendula ngokucaphuna


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-29, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   I-Linuxito kusho

    Ngiyaxolisa kepha lokhu kungukuphazamiseka okwedlulele kwezokuphepha !! Unephasiwedi ebhajwe kuzikripthi, amafayela wombhalo ocacile, umlando we-bash, njll.
    Ngalokho, i-opensh isekela ukuqinisekiswa kokhiye womphakathi usebenzisa i-RSA.
    Ngenxa yalolu hlobo lwenkambiso (olusetshenziswa yizihloko ezizibiza ngokuthi "abaphathi") kunokungazethembi okukhulu kwamakhompyutha.
    Ukubingelela

    1.    izinga kusho

      Asibone. Yebo, kuyinkinga yezokuphepha kepha akusho ukuthi "izifundo" ezingabaphathi noma ezingezona abaphathi kumele zisebenzise le ndlela. Le ndlela ikhona futhi iyakhonjiswa uma kungenzeka ukuthi isetshenziswe endaweni lapho ukuphepha kungeyona inkinga. Esitolo bakuthengisela ummese, unquma ukuthi uwusebenzisa ukusika imifino noma ukubulala umuntu.

      1.    I-Linuxito kusho

        Ngiyakuqonda ukuma kwakho, kodwa ngiyaxolisa ukuthi kubhulogi lodumo olunjalo bakhuthaza lolu hlobo lokuzijwayeza, kucishe kufane "nokuxolisa ngokuphathwa kohlelo olubi" hehe.
        Ukwanga !!

        1.    izinga kusho

          Angikaqondi ukuthi yini inkinga 🙁

          Njengoba sikhulume nangendlela "yokuthola ukuphepha okwengeziwe" ezicini ezahlukahlukene, singakhuluma nangezinye izihloko "ezingaphephile". Inhloso yethu ukunikeza imininingwane, kukuwe ukuthi wazi ukuthi wenzeni ngayo. Ngaphezu kwalokho, umbhali wokuthunyelwe okuphambanisa kakhulu ngokuphepha angeke abe, ngikholwe, uma kukhulunywa ngokuPhathwa kweSystem, ayenzi lolu hlobo lwento.

          Sanibonani

          1.    I-Linuxito kusho

            Okokuqala, lapho ngithi 'kwenziwa yizifundo ezizibiza ngokuthi "abaphathi"', angizange ngibhekise nganoma yisiphi isikhathi kumbhali wale ndatshana, angiqondi ukuthi kungani besengozini enkulu kangaka.

            Inkinga, ngokubuka kwami, ukuthi leli thuluzi liphikisana nayo yonke imikhuba emihle yokuphepha. Ngikholwa ukuthi kusuka emphakathini we-GNU / Linux kufanele sigcine uhlelo lwethu oluyigugu lokusebenza luphephe ngangokunokwenzeka. Ngiqonde ukuthi, angifuni ukubona i-GNU / Linux iphendulwa iWindows (ukuphepha kuhlakaniphile).

            Ngeshwa kunabaphathi abaningi be-novice abangayazi indlela eyiyo yokwenza izinto, futhi bagcina besebenzisa la mathuluzi kuzinhlelo ezibucayi.

            Vele unelungelo lokushicilela noma yini oyifunayo, kepha ngiyaphinda, kuyangidabukisa ukuthi le bhulogi (enye yamabhulogi abaluleke kakhulu abakhuluma iSpanishi) inikela ngamathuluzi asongela ukuphepha.

            Saludos !!

            1.    izinga kusho

              Futhi unikeze uJuana ngomcengezi. Ngokuqondile, ngoba ibhulogi eyisithenjwa, sithanda ukuhlinzeka ngazo zonke izinhlobo zolwazi. Ngiyakuqonda lokhu:

              Umsebenzisi ufika abuze: Ngingaxhuma kanjani kuseva ngeSSH ngaphandle kokucela iphasiwedi?
              Bayamphendula kunoma yisiphi isithangami: Noooo, leyo inkinga yokuphepha, akekho owenza lokho.

              Ngisho nokwazi, umsebenzisi akamtsheli ukuthi kungani kuyinkinga yezokuphepha. Kubi, kubi kakhulu, kuhle ukuthi uyakwazi ukwenza izinto, yingakho eDesdelinux:

              Umsebenzisi ufika abuze: Ngingaxhuma kanjani kuseva ngeSSH ngaphandle kokucela iphasiwedi?
              Sibhala okuthunyelwe bese sithi: Ungasebenzisa le ndlela, isebenza ngale ndlela kepha AKUPHEPHILE. Into ephephe kunazo zonke ukusebenzisa le enye.

              Yimuphi ocabanga ukuthi ungcono?


            2.    I-Linuxito kusho

              Kulungile, ngiyasihlonipha isimo sakho. Ozithobayo!!


            3.    KZKG ^ Gaara kusho

              I-SSHPass empeleni ayikusongeli ukuphepha, umuntu osongela ukuphepha noma ngabe ikuphi umsebenzisi oyisebenzisa kabi.
              Isibonelo, nasi isibonelo esihle kakhulu sokuthi i-SSHPass ayisetshenziselwa kuphela lokho engikuphawula kokuthunyelwe, ingasetshenziselwa (ngokwesibonelo) ukuqhekeka kwe-OpenSSH-Server: http://paste.desdelinux.net/4810

              Uhlelo lokusebenza aludluli nje lapho, uhlelo lokusebenza, ukusetshenziswa okunikezwayo yilokho okuzodala ukwehluleka okubeka ukuphepha engcupheni noma cha.

              Mayelana nokwethuka noma ukuthinteka, nakancane, mhlawumbe bekuyindlela osho ngayo (noma ukuthi ukufunda kwenza kube nzima ukuqonda kahle) kepha ngikuhumushile ukuthi ukuphawula bekuqondiswe kimi, uma bekungenjalo, ngiyaxolisa.

              I-PS: Impela kuzoba nabaningi abazothola iskripthi engisibeka ngokuthakazelisa futhi esihlekisayo iLOL!


            4.    I-Linuxito kusho

              Kulungile, ngiyajabula ukuthi sifinyelele esivumelwaneni. Halala !!


    2.    KZKG ^ Gaara kusho

      Ngabe ngike ngasho ukuthi le ndlela iphephe kakhulu kunokusebenzisa okhiye bomphakathi nabangasese?

      Kwenye indatshana engivele ngabelane ngayo ukuthi ngiyisebenzisa kanjani [1], manje ngichaza enye indlela yokufeza okufanayo noma okufanayo.

      Wonke umuntu usebenzisa leyo evumelana naye kakhulu, leyo ayithandayo. Lapha ngivele ngachaza okunye ukusetshenziswa okunganikezwa i-sshpass, okunye kungaba ngeskripthi seBash sokuqhekeza i-SSH ngokusebenzisa isichazamazwi ... kepha woza, lokhu okunye ukusetshenziswa.

      Ngiyaphinda ngithi, ngabelana kuphela ngolwazi lwami oluhlobene neGNU / Linux. I-SSHPass kungenzeka ingabi inketho ekahle kunoma yiliphi icala, kepha inokusetshenziswa, ungangabazi.

      I-BTW, ebhekise ku: (kusetshenziswa izihloko ezizibiza "ngabaphathi") ... heh ... heh ... heh ... ngincamela ukungaphawuli, anginalutho engingakufakazela noma ngubani, ingasaphathwa eyokuthi mngani wami, awunawo umqondo okude kakhulu wokuthi ngingubani, okuncane kakhulu kunalokho engikwaziyo 😉

      [1] https://blog.desdelinux.net/ssh-sin-password-solo-3-pasos/

      1.    I-Linuxito kusho

        Ungethuki, kuyenzeka ukuthi emkhakheni wami ngibazi abantu abasekela umsebenzi wabo kuGoogle futhi lapho bexazulula izinkinga bakopisha futhi banamathisele lolu hlobo lwento. Lapho-ke umphathi wezokuphepha nguyena "ofaka amasondo esondweni" lapho ethola lezi zinhlobo zokungahambi kahle. Halala !!

      2.    msx kusho

        Khululeka ndoda, akukufanele 😉

  2.   Xykyz kusho

    Impela, kepha lapho-ke iphasiwedi ibhalisiwe emiyalweni esetshenzisiwe. Ngenxa yezizathu zokuphepha, lokhu akufanele kwenziwe ...

    1.    davidlg kusho

      Yilokho ebengikucabanga lapho ngifunda okuthunyelwe

    2.    KZKG ^ Gaara kusho

      Ukungeza lokhu ku-.bashrc yethu ngeke kulondoloze imiyalo ehlobene ne-sshpass:
      HISTIGNORE='sshpass *'

      Ngizobe ngenza okuthunyelwe kokuthi ungayinaki kanjani imiyalo ukuze ingagcini umlando we-bash kungekudala :)

      1.    angelblade kusho

        Enye indlela yokuthi imiyalo ingagciniwe ukubeka njalo isikhala ngaphambi komyalo. ^ __ ^

  3.   Ignacio kusho

    Ngicabanga ukuthi kuphephile ukusebenzisa okhiye ukuxhuma nge-SSH ngaphandle kokufaka iphasiwedi.

    Ngakolunye uhlangothi, ukudala i-alias ephelele yomyalo lapho kugcinwa khona iphasiwedi kungaba yinkinga yokuphepha.

  4.   Saito kusho

    Uma kimi kubonakala kunephutha ekuphepheni kwamakhompiyutha, kepha sizokwenza isiqiniseko sokuthi azilondolozwa emlandweni we-bash akuyona inkinga esiyenzayo (ngaphandle kwegama elingaba ubumbano), futhi njengoba u-elav esho isitolo usithengisele ummese yithi esizobona ukuthi sizowusebenzisa kanjani

  5.   truko22 kusho

    Kuyathakazelisa, kepha sebenzisa kangcono ukhiye womphakathi nowangasese owukhombisile kokunye ukungena.

  6.   msx kusho

    @Ukhozi_fm
    Ngicabanga ukuthi kuyasebenza - futhi kuphephile! - Sebenzisa okhiye be-RSA / ECDSA kanye nesikhiye (umenzeli weSSH) ukuqinisekisa okuzenzakalelayo.
    Mina, ngisebenzisa i-SSH keychain ku-Keychain, eyenziwe abantu baseFuntoo, esebenza kahle kakhulu, isebenzisa izinsiza ezimbalwa kakhulu futhi ivikeleke kakhulu:
    http://www.funtoo.org/Keychain

    Isibonelo:

    j:0 ~ > AliasSearch ssh
    # SSH management
    alias SSHCOPYIDecdsa='ssh-copy-id -i ~/.ssh/id_ecdsa.pub'
    alias SSHCOPYIDrsa='ssh-copy-id -i ~/.ssh/id_rsa.pub'
    alias SSHKEYGENecdsa='ssh-keygen -t ecdsa -b 521 -C "$(whoami)@$(hostname)-$(date -I)"'
    alias SSHKEYGENrsa='ssh-keygen -t rsa -b 4096 -C "$(whoami)@$(hostname)-$(date -I)"'

    I-Forma de uso:
    I-SSHKEYGEN {ecdsa, rsa}
    I-SSHCOPYID {ecdsa, rsa} user @ {server, ip}


    # SSH servers
    alias SERVER1mosh='eval $(keychain --eval --agents ssh -Q --quiet id_ecdsa) && mosh -p # usr1@server1'
    alias SERVER1='eval $(keychain --eval --agents ssh -Q --quiet id_ecdsa) && ssh -v -p # usr1@server1.local'
    alias SERVER101='eval $(keychain --eval --agents ssh -Q --quiet id_ecdsa) && ssh -v -p # usr1@[direc. ip].101'

    Kuphi:
    -p #: imbobo
    usr1 @ server1: umsebenzisi @ Iseva ye-AVAHI
    usr1@server1.local: user @ AVAHI server (kuya ngokuthi iseva yakheke kanjani kwezinye izinhlelo kuyadingeka ukwengeza isijobelelo .local)
    usr1 @ [addr. ip] .101: ikheli le-ip elihleliwe.

    / njll / ssh / sshd_config: http://paste.chakra-project.org/4974/
    ~ / .ssh / config: http://paste.chakra-project.org/4975/
    I-OS: I-Arch Linux / Chakra

    Ngiyethemba iyakusebenzela, imikhonzo!

    1.    KZKG ^ Gaara kusho

      Eqinisweni ngisebenzisa okhiye, hhayi i-SSHPass ukufinyelela amaseva wami ... ngithole i-SSHPass lapho ngidinga indlela yokwenza lo mbhalo: http://paste.desdelinux.net/4810

      Kepha ... kahle, bengifuna ukwabelana nge-SSHPass nawo wonke umuntu, kepha kusobala angikwazi ukubeka lapha umbhalo ovumela ukusebenzisa isichazamazwi ukuzama ukwephula i-OpenSSH-Server HAHAHA!

      1.    msx kusho

        "[…] Angikwazanga ukubeka lapha umbhalo ovumela ukusebenzisa isichazamazwi ukuzama ukwephula i-OpenSSH-Server HAHAHA!"
        Kepha kungani kungenjalo !!?
        Ingabe ukugqekeza nokuqhekeka akuyona ingxenye yokufunda izindlela ezinhle zokuphepha [0]!?
        Ngiyacela ndoda, qhubeka !!!

        [0] Akukuhle yini ukusebenzisa amagama ukusho okuphambene ngqo nalokho okushiwo ngokoqobo!? Hack izilimi !!! ; - D

      2.    guzmanweb kusho

        Sawubona, ngithola leli phutha:

        Ihlola amaphasiwedi ku-192.168.20.11 ethekwini 22 nomsebenzisi oyimpande
        ikati: con-letters.txt: Alikho lelo fayela noma umkhombandlela

        ifayela eline-letters.txt ngiyazidala?

        imikhonzo

  7.   Eduardo kusho

    Lokhu akwenziwa, ngoba iphasiwedi igcinwa ku-bash_history njengombhalo osobala, ngaphandle kwalokhu kungatholakala ngenye indlela. Ngakho-ke ukuthi i-ssh ayikubuzi iphasiwedi, indlela eyiyo ngukuthi "okhiye bomphakathi nabangasese".

  8.   Oscar Meza kusho

    Ngisebenzisa i-RSA ukuxhuma kumaseva ami ukude, noma kunjalo ngicabanga ukuthi ukuxhuma kwikhompyutha ethile lapho singadingi ukuphepha okuqinile njengethuluzi elihle, ngiyabonga ngethiphu!

  9.   Nelson kusho

    Chiuuu

  10.   UNebukadinesari kusho

    Futhi kungani kungcono ungashicileli iphasiwedi yami ukuze itholakale kunoma ngubani?

  11.   Mario kusho

    Kuhle kakhulu lokho !!!!!! nangeSpanish.

  12.   UGonzalo Jarjury kusho

    I-athikili enhle kakhulu, njengenjwayelo abantu bayakhalaza esikhundleni sokubonga, yize indlela ingavikelekile kuya ngokuthi uyisebenzisa kuphi nokuthi kanjani, ngiyabonga kakhulu 🙂