snipt

Ctrl+h for KB shortcuts

Text only

Keep ssh sessions alive in Debian/Ubuntu

1) Edit /etc/ssh/ssh_config and add: 

ServerAliveInterval 5

2) reload ssh:

sudo service ssh reload      

3) What does it do?:
The client will send every 5 seconds a small keep-alive packet to the server in order to use ssh connection. 
https://snipt.net/embed/551e8213f765a0aa9334315aa71530bb/
/raw/551e8213f765a0aa9334315aa71530bb/
551e8213f765a0aa9334315aa71530bb
text
Text only
10
2019-07-23T16:43:22
True
False
False
Jun 05, 2013 at 04:17 AM
/api/public/snipt/62485/
keep-ssh-sessions-alive-in-debianubuntu
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>1) Edit /etc/ssh/ssh_config and add: </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>ServerAliveInterval 5 </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>2) reload ssh: </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a>sudo service ssh reload </span><span id="L-8"><a name="L-8"></a> </span><span id="L-9"><a name="L-9"></a>3) What does it do?: </span><span id="L-10"><a name="L-10"></a>The client will send every 5 seconds a small keep-alive packet to the server in order to use ssh connection. </span></pre></div> </td></tr></table>
Debian, Linux, Ubuntu, keepalive, ssh