Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Keep Your Linux SSH Session From Disconnecting Keep Your Linux SSH spojenie z Odpojenie

I'm the type of geek that has an SSH client open at all times, connected to my most frequently used servers so that I have instant access for monitoring and anything else. Som typ, ktorý má geek SSH klient otvorený po celú dobu, spojila so svojím najčastejšie používaných serverov, takže som si okamžitý prístup k monitorovaniu a nič iného. As such, it irritates me greatly when I get disconnected, so I'm sharing a few methods for keeping your session alive. Ako taký, to ma veľmi rozčuľuje, keď sa odpojí já, takže som zdieľať niekoľko metód pre udržanie svojho zasadnutia nažive.

You can configure the ssh client to automatically send a protocol no-op code code every number of seconds so that the server won't disconnect you. Môžete nakonfigurovať ssh klient automaticky zaslať protokol no-op kód kód každých niekoľko sekúnd, takže server nebude odpojí vás. This is setting is sometimes referred to as Keep-Alive or Stop-Disconnecting-So-Much in other clients. Toto je nastavenie sa niekedy označuje ako Keep-Alive alebo Stop-odpojenie-So-Much v iných klientov.

Global Configuration Globálna konfigurácia

Add the following line to the /etc/ssh/ssh_config file: Pridajte nasledujúci riadok do súboru / etc / ssh / ssh_config súboru:

ServerAliveInterval 60 ServerAliveInterval 60

The number is the amount of seconds before the server with send the no-op code. Číslo je počet sekúnd pred servera s odoslaním no-op kód.

Current User Configuration Aktuálne Konfigurácia užívateľa

Add the following lines to the ~/.ssh/config file (create if it doesn't exist) Pridajte nasledujúce riadky do ~ /. Ssh / config file (vytvoriť, ak neexistuje)

Host * Host *
ServerAliveInterval 60 ServerAliveInterval 60

Make sure you indent the second line with a space. Uistite sa, že zarážka druhého riadku s medzerou.

Per-Host Configuration Per-Host Configuration

If you only want to enable keep alive for a single server, you can add that into the ~/.ssh/config file with the following syntax: Ak chcete iba umožniť udržať nažive jeden server, môžete doplniť, že do ~ /. Ssh / config súbor s nasledujúce syntaxou:

Host *hostname.com Host * hostname.com
ServerAliveInterval 60 ServerAliveInterval 60

Works quite well, hope it helps somebody else out there. Funguje pomerne dobre, dúfam, že pomôže niekto iný tam vonku.

This article was originally written on 08/16/07 Tagged with: Tento článok bol pôvodne napísaný na 08/16/07 Tagged s: Linux Linux

Daily Email Updates Denný Svářeč

You can get our how-to articles in your inbox each day for free. Môžete si naše jak-na články vo vašej schránky každý deň zadarmo. Just enter your name and email below: Stačí zadať svoje meno a e-mail nižšie:


Name: Meno:
Email: E-mail:

Comments (8) Komentáre (8)

  1. Micha Micha

    Thanks a lot! Díky moc!

    That'll save my life! Že ušetríte môj život!
    OK, I wouldn't die if i didn't know this, but it shuold make life easier. OK, nechcel som zomrieť, keby som to nevedel, ale to shuold uľahčí život. I hate being disconnected… Nenávidím odpojenie ...

  2. Chuck Chuck

    That's a great tip. To je skvelý tip. Another idea (one you can use in tandem with the above) is to use the “screen” program. Ďalší nápad (jeden možno použiť v tandeme s vyššie), je použiť "obrazovka" program. Then, if you are somehow disconnected you can just re-atach the screen and all your stuff is there just as you left it. Potom, ak ste nejako odpojený stačí re-ataché obrazovku a všetky veci sa tam tak, ako ste opustili.

  3. Dan Dan

    Already knew this, but it popped up on my iGoogle page as I have your feed on there, great tip and excellent explination, KISS Už to vedel, ale vyskočila na mojej stránky iGoogle, ako som si tam na kŕmenie, skvelé a vynikajúce tip explination, KISS : D (Keep it simple Stupid) (Keep it simple stupid)

    I'll be pointing some of my customers to this blog entry Budem sa ukázal niektoré z mojich zákazníkov k tomuto príspevku v blogu : P

  4. oOJINxOo oOJINxOo

    ty soooo much ^_^ ty soooo much ^ _ ^

  5. Nathan Nathan

    Helped much, thanks mate! Veľa pomohol, díky kámo!

  6. Ammar Ammar

    thnx thnx :)

  7. Chris Chris

    So I have an account to a linux machine @ school that I do most of my programming projects through. Tak som si účet na stroji linux @ školu, že som si väčšina mojich projektov prostredníctvom programov. I ssh into my account and work from there and many a times my session times out while reading a how-to article and I have to reconnect( annoying ). Som ssh na svoj účet a pracovať tam a veľa z mojich čias zasadnutí časový limit pri čítaní ako-na článok a musím pripojiť (otravné). The thing is security on my schools system is really tight. Tá vec je bezpečnosť na svojich školách systému je naozaj tesný. /what I want to know is will I be able to run this command as joe user or do I need root permission to do it? / To, čo chcem vedieť, sa budem môcť spustiť tento príkaz ako joe užívateľovi alebo musím root povolenie na to? I can edit some things like my bash profile but I cannot add programs with apt or change any system files….. Môžem upraviť niektoré veci, ako môj profil bash, ale nemôžem pridávať programy s apt alebo zmeniť niektoré systémové súbory ... .. It seems like the session time is something regulated by the systems admins but idk……… thanks for your help. Vyzerá to, že čas je niečo, čo zasadnutí riadi systémy, správcovia, ale idk ... ... ... vďaka za vašu pomoc. I love this blog! I love this blog!

  8. linux lover linux milenca

    Thanks for this tips. Thanks for this tipy.
    It help me much today, working on SSH connection. Pomohlo mi veľa dnes pracuje na SSH spojenie.


Leave a Comment Zanechať komentár




Leave your Zanechajte svoj friendly priateľský comment here. komentár tu.

If you have a computer help question, Ak máte počítač pomôže otázku, click here to leave it on the forums kliknite tu nechať to na fórach instead. miesto.

Note: Your comment may not show up immediately on the site. Poznámka: Váš komentár sa nezobrazia okamžite na mieste.

Our Friends Naši priatelia
Getting Started Začíname


About How-To Geek O tom, ako-To Geek
What Is That Process? Čo je to za proces?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe Dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe WMPNSCFG.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.