How to prevent your SSH session from disconnecting in Linux Kā novērst jūsu SSH sesiju atvienot Linux

by Sukrit Dhandhania on April 16, 2009 ar Sukrit Dhandhania 2009 Aprīlis 16,

Linux

Anyone who has worked with a remote Linux server using SSH must have faced the problem of having the SSH session drop dead when you head out to get a cup of coffee. Ikviens, kurš ir strādājis ar tālvadības Linux servera, izmantojot SSH jābūt saskārās problēmu saistībā ar SSH sesiju piliens miris, kad vadītājs, lai saņemt tasi kafijas. Well, here's a solution to help you configure your SSH daemon on the Linux server to stop it from disconnecting. Nu, šeit risinājumu, lai palīdzētu jums konfigurēt jūsu SSH daemon par Linux serveri, lai apturētu to atvienot. What happens is that if you leave your SSH connection on and don't use it for some time the SSH server goes into an idle mode and kills the session. Kas notiek, ir tas, ka, ja esat atvaļinājumā jūsu SSH savienojums un nelieto to kādu laiku SSH servera tērēta tukšgaitas režīmā un nogalina sesiju. This is really a security measure which can sometimes be a little annoying. Tas tiešām ir drošības pasākums, kas dažkārt var būt nedaudz kaitinošas.

To set this up log on to your remote Linux server using SSH. Noteikt šo pat pieteikties uz Jūsu tālvadības Linux servera, izmantojot SSH. Open the SSH configuration file: Open SSH konfigurācijas failu:

# vim /etc/ssh/ssh_config # Spars / etc / ssh / ssh_config

Add the following line at the end of the file: Pievienot šādu rindu beigās failu:

ServerAliveInterval 60 ServerAliveInterval 60

Save the file and quit the text editor. Saglabājiet failu un atmest teksta redaktoru. Now, similarly, open the file ~/.ssh/config . Tagad, līdzīgi, atveriet failu ~ / .ssh / config. Create the file if it does not already exist. Izveidot failu, ja tas jau nav iesniegta. Add the following lines: Pievieno šādas rindas:

Host * Host *
ServerAliveInterval 60 ServerAliveInterval 60

Note: you need to indent the second line by entering a space at the beginning of the line. Piezīme: Jums ievilkuma otrajā rindiņā ievadot telpas pie sākuma līnijas.

You're all done now. Jūs visi darīt tagad. Time to restart your SSH server. Laiks, lai restartētu SSH serveri. Run the following command: Palaist šādu komandu:

# /etc/init.d/sshd restart # / Etc / init.d / sshd restart

This should take a second or two. Tam būtu jāpieņem otrā vai divas. Then you should be back in business. Tad jums vajadzētu būt atpakaļ biznesā. What we have done here is that we have pretty much fooled the SSH server into thinking that your SSH session is active even when it's not. Ko mēs esam izdarījuši šeit ir tas, ka mums ir diezgan daudz fooled SSH serverim domāt, ka jūsu SSH sesija ir aktīva, pat ja tas nav. Now you can peacefully take a short coffee break without losing your SSH connection. Tagad varat mierīgi ņemt īsu kafijas pauze, nezaudējot savu SSH savienojumu.

Related Posts: Related Posts:
  • How to prevent RSI on Windows and Linux with Workrave Kā novērst RSI uz Windows un Linux ar Workrave
  • How to recursively copy files from an FTP server with Linux Kā rekursīvi kopēt failus no FTP serveri ar Linux
  • How to monitor your Linux machine with netstat Kā kontrolēt savu Linux mašīna ar netstat
  • How to SSH from your Windows Mobile Smartphone Kā SSH no Windows Mobile Smartphone
  • SmallScreenX – simulate screen resolutions in OS X SmallScreenX - simulēt ekrāna rezolūciju OS X
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Get Simple Palīdzība konsultācijas tāpat kā šo vienu savā e-pastā ik dienas - bez maksas! Just enter your email address below: Vienkārši ievadiet savu e-pasta adresi:

    You can always opt out of this email subscription at any time. Jūs vienmēr varat atteikties no šīs e-pasta abonementu jebkurā laikā.

    { 0 comments… (0 comments ... add one now pievienot vienu tagad } )

    Leave a Comment Leave Comment

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Jūs varat izmantot šos HTML tagus un atribūtus: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>