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 Session From Prekinjanje

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. Jaz sem tip geek, ki je SSH client odprta ves čas, v zvezi z mojim najbolj pogosto uporabljenih strežnikov, tako da imam takojšen dostop za spremljanje in nič drugega. As such, it irritates me greatly when I get disconnected, so I'm sharing a few methods for keeping your session alive. Kot taka, da me močno dražiti, ko me prekine, tako da sem delitev nekaj metod za ohranjanje svoje zasedanje živ.

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. Lahko nastavite ssh odjemalca za samodejno pošlje protokol, no-op kode kode vsakih število sekund, tako da strežnik ne bo vas prekiniti. This is setting is sometimes referred to as Keep-Alive or Stop-Disconnecting-So-Much in other clients. To je nastavitev je včasih imenovan Keep-Alive ali Stop-Prekinjanje-So-Much v drugih strank.

Global Configuration Global Configuration

Add the following line to the /etc/ssh/ssh_config file: Dodajte naslednjo vrstico v / etc / ssh / ssh_config datoteke:

ServerAliveInterval 60 ServerAliveInterval 60

The number is the amount of seconds before the server with send the no-op code. Številka je znesek sekund, preden pošlje strežniku z no-op kode.

Current User Configuration Current User Configuration

Add the following lines to the ~/.ssh/config file (create if it doesn't exist) Dodajte naslednje vrstice v ~ / .ssh / config file (ustvari če ne obstaja)

Host * Gostujoči *
ServerAliveInterval 60 ServerAliveInterval 60

Make sure you indent the second line with a space. Preverite, ali ste alinee drugega skladu s presledkom.

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: Če želite omogočiti le obdržati pri življenju, za en strežnik, lahko dodate, da v ~ / .ssh / config datoteko z naslednjo sintakso:

Host *hostname.com Gostujoči * hostname.com
ServerAliveInterval 60 ServerAliveInterval 60

Works quite well, hope it helps somebody else out there. Deluje precej dobro, upanje to pomoč nekdo drug tam zunaj.

This article was originally written on 08/16/07 Tagged with: Ta članek je bil prvotno napisan na 08/16/07 Tagged with: Linux Linux

Daily Email Updates Dnevni Email Updates

You can get our how-to articles in your inbox each day for free. Lahko dobite našo kako do člankov v vašo mapo »Prejeto vsak dan brezplačno. Just enter your name and email below: Preprosto vpišite vaše ime in e-pošto spodaj:


Name: Ime:
Email: E-pošta:

Comments (8) Komentarji (8)

  1. Micha Micha

    Thanks a lot! Hvala veliko!

    That'll save my life! Tako boste prihranili moje življenje!
    OK, I wouldn't die if i didn't know this, but it shuold make life easier. OK, jaz ne bi umrl, če jaz ne vem to, ampak shuold olajšali življenje. I hate being disconnected… Sovražim se odklopi ...

  2. Chuck Chuck

    That's a great tip. To je velik odlagališče. Another idea (one you can use in tandem with the above) is to use the “screen” program. Druga ideja (eden jih lahko uporabljate skupaj z zgoraj), je z uporabo "screen" 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. Potem, če ste nekako povezani, lahko samo ponovno atach zaslon in vse svoje stvari, je tam tako kot ste ga pustili.

  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 Že to vedel, vendar je pojavil na mojo stran iGoogle kot sem vaš vir tam, velik odlagališče in odlično explination, KISS : D (Keep it simple Stupid) (Keep it simple Stupid)

    I'll be pointing some of my customers to this blog entry I'll be kaže nekatere od mojih strank na ta blog vpis : P

  4. oOJINxOo oOJINxOo

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

  5. Nathan Nathan

    Helped much, thanks mate! S pomočjo veliko, hvala kolega!

  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. Torej imam račun v linux stroj @ šolo, da delam večina mojih programskih projektov skozi. 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 ). I ssh na svoj račun in delo od tam, in veliko krat mi sejo čas iz med branjem, kako do izdelka, in sem znova (siten). The thing is security on my schools system is really tight. Stvar je varnost na šolah svoj sistem je zelo tesen. /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? / kaj hočem vedeti, je, bom lahko zaženete ta ukaz kot vojak uporabnika ali moram root dovoljenje, da naredi? I can edit some things like my bash profile but I cannot add programs with apt or change any system files….. I lahko uredite nekaj stvari všeč moj profil bash, vendar ne morem dodati programe z apt ali zamenjate katera koli sistemske datoteke ... .. It seems like the session time is something regulated by the systems admins but idk……… thanks for your help. Zdi se, kot je nekaj časa sejo ureja sistem administratorji, ampak idk ... ... ... hvala za vašo pomoč. I love this blog! I love this blog!

  8. linux lover linux ljubimec

    Thanks for this tips. Hvala za te nasvete.
    It help me much today, working on SSH connection. Prav veliko pomoč mi je danes, ki delajo na SSH povezavo.


Leave a Comment Pustite komentar




Leave your Pustite friendly prijazen comment here. comment here.

If you have a computer help question, Če imate računalnik pomagati vprašanje, click here to leave it on the forums kliknite tukaj, da ga pustijo na forumih instead. namesto.

Note: Your comment may not show up immediately on the site. Opomba: Tvoj komentar morda ne pokažejo takoj na mestu.

Our Friends Naši prijatelji
Getting Started Getting Started


About How-To Geek O Kako naj Geek
What Is That Process? Kaj je to proces?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe Ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
mDNSResponder.exe mDNSResponder.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.