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.























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