Linux – How to change ssh timeout on server side

linuxredhatssh

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?

Best Answer

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

https://unix.stackexchange.com/questions/34004/how-does-tcp-keepalive-work-in-ssh

Related Topic