Solved

SSH disconnects after a certain time.

Posted on 2007-11-19
10
1,758 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

685 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