Solved

SSH disconnects after a certain time.

Posted on 2007-11-19
10
1,739 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Hello to you all, I hear of many people congratulate AWS (Amazon Web Services) on how easy it is to spin up and create new EC2 (Elastic Compute Cloud) instances, but then fail and struggle to connect to them using simple tools such as SSH (Secure…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

911 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

23 Experts available now in Live!

Get 1:1 Help Now