Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shell script to export oracle tables. The script will print some text during executing, such as "exporting tt_customers......1343 rows exported". This script was run on redhat 5.7 enterprise server.

The problem is when exporting some big tables, the ssh client will block infinitely. Actually after sometime the script was finished.

Someone said because the ssh client didn't get any response for too long time, the connection was closed. I have changed the putty setting "connection->seconds between keepalives(0 to turn off)" to 60, the script was executed successfully.

But our customers use .net application run the script remotely and I don't want to change the .net application. So I hope to solve it on server side, without changing the client configuration and the command (such as nohup).

I changed config items in /etc/ssh/sshd_config like this:

 ClientAliveInterval 300
 TCPKeepAlive yes
 ClientAliveCountMax  5 

And I restarted the ssh server:

/sbin/service sshd restart

The script still cannot run successfully.

How should I change the configuration?

share|improve this question

migrated from Nov 22 '12 at 13:56

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

You may want to use ServerAliveInterval and ServerAliveCountMax see following question:

share|improve this answer
Thank for your reply. But that's not my purpose. Our customers use .net application to execute the script remotely and I don't want to change the .net application. I missed it in my question. – bucherren Nov 23 '12 at 1:37
Yes, It's better to change the config at client side. – bucherren Nov 23 '12 at 3:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.