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?


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


  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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