Solved

SSH disconnects after a certain time.

Posted on 2007-11-19
10
1,735 Views
Last Modified: 2013-12-27
When I start a ssh session with one of my server, if I am not active for 60 sec it automatically time out.  

1. Where is configure?  
2. How do I stop it form timing out.  

Thanks
0
Comment
Question by:simpsonjr
  • 6
  • 4
10 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 20314791
A few possibilities.

1.  There is a firewall dropping connections idle for >=1 min.  In which case, you either need to use a client keepalive (putty has this option), or possibly TCP keepalives on the server side.

2.  Your shell (ksh/bash) has the TMOUT environment variable set to 60, which causes your login session to log out if you are idle for more than 60 seconds *and* you are at the shell prompt.

0
 
LVL 48

Expert Comment

by:Tintin
ID: 20314806
3.  Related to 1, there's the KeepAlive option in /etc/sshd/sshd_config
0
 

Author Comment

by:simpsonjr
ID: 20315263
There is a KeepAlive setting in the sshd_config.  

It currently is set:

 KeepAlive yes

It is set to yes on server that are not booting me out as well..  



0
 
LVL 48

Expert Comment

by:Tintin
ID: 20315305
What about points 1 and 2?
0
 

Author Comment

by:simpsonjr
ID: 20315350
There is no firewall dropping the connection.  

and  

#Your shell (ksh/bash) has the TMOUT environment variable set to 60, which causes your login session to #log out if you are idle for more than 60 seconds *and* you are at the shell prompt

I don't even know how to check this.  

0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 48

Expert Comment

by:Tintin
ID: 20315375
From the shell prompt, type

echo $TMOUT
0
 

Author Comment

by:simpsonjr
ID: 20315435
I get nothing when I run that command.  

Here is another twist in the puzzle.  When I ssh from another Solaris server, I don't get booted.  But every client I use does.  

The clients I am using are Putty and the terminal in OSX.  

 
 
0
 
LVL 48

Accepted Solution

by:
Tintin earned 250 total points
ID: 20315504
In putty, if you go to the Connections menu and put a value (say 30) in "Seconds between keepalives", does it make any difference?
0
 

Author Comment

by:simpsonjr
ID: 20315935
That worked for Putty.  What about my OSX Terminal?  
0
 
LVL 48

Expert Comment

by:Tintin
ID: 20317274
Not familiar with OSX terminal.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now