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. Každý, kto pracuje so vzdialeným serverom Linuxu cez SSH musel čeliť problému s SSH chcípnutí, keď hlavu von, aby si šálku kávy. Well, here's a solution to help you configure your SSH daemon on the Linux server to stop it from disconnecting. No, tu je riešenie, ktoré vám pomôžu konfigurovať SSH démona na serveri Linux zastaviť od odpojenie. 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. Čo sa stane, je, že ak opustíte svoju SSH pripojenia a nepoužívajte ho po nejakú dobu SSH server prejde do režimu voľnobehu, a zabije zasadnutí. This is really a security measure which can sometimes be a little annoying. To je naozaj bezpečnostné opatrenie, ktoré môže byť niekedy trochu nepríjemné.
To set this up log on to your remote Linux server using SSH. Nastavenie vykonať prihlásení k vzdialenému serveru Linuxu cez SSH. Open the SSH configuration file: Otvorte konfiguráciu SSH file:
# vim /etc/ssh/ssh_config # Vim / etc / ssh / ssh_config
Add the following line at the end of the file: Pridajte nasledujúci riadok na koniec súboru:
ServerAliveInterval 60 ServerAliveInterval 60
Save the file and quit the text editor. Uložte súbor a ukončite textový editor. Now, similarly, open the file ~/.ssh/config . A teraz, podobne, Otvoriť súbor ~ /. Ssh / config. Create the file if it does not already exist. Vytvorte súbor, ak ešte neexistuje. Add the following lines: Pridajte nasledujúce riadky:
Host * Host *
ServerAliveInterval 60 ServerAliveInterval 60
Note: you need to indent the second line by entering a space at the beginning of the line. Poznámka: musíte zarážky druhého riadku zadaním miesto na začiatku riadku.
You're all done now. Ste všetci hotovo. Time to restart your SSH server. Čas reštartovať SSH server. Run the following command: Zadajte nasledujúci príkaz:
# /etc/init.d/sshd restart # / Etc / init.d / sshd restart
This should take a second or two. To by malo trvať sekundu alebo dve. Then you should be back in business. Potom by ste mali byť späť v hre. 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. To, čo sme urobili je, že máme docela hodně zmiasť SSH server, aby si mysleli, že vaša SSH je aktívna, aj keď to nie je. Now you can peacefully take a short coffee break without losing your SSH connection. Teraz si môžete pokojne vziať krátke prestávky na kávu, bez toho aby ste stratili SSH spojenie.























{ 0 comments… (0 comments ... add one now pridať jednu teraz } )
Leave a Comment Zanechať komentár