Other *NIXThis forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I provide support to a bunch of remote locations through my job. Unfortunately all the locations are on a regular up and down dial up connection. When sending files/updates to the locations, we are sending the files via scp then kicking off an install script via ssh. Here is my problem:
1. The ssh command kicks off.
2. The ssh command makes the connection and begins the remote script.
3. The connection is lost to the location before it can get a return code back from the ssh/remote script.
This causes the ssh command to hang for a long time. Some times upwards of 1.5 hours. I'm wondering what controls this timeout and if there is anything I can do to force the ssh to die quicker.
I already know about the ConnectTimeout setting. This only affects making the initial connection to the location, not a drop in the middle of one.
We are using ssh version 3.8p1 on SCO 5.0.7 if that helps at all.
I did determine it is finally timing out exactly 2 hours after the ssh command began. I can't find this setting anywhere. I checked ssh settings as well as some TCP settings and can't seem to find it. A process sitting there for 2 hours before it gives up is kind of crazy.
What does "cat /proc/sys/net/ipv4/tcp_keepalive_time" say? If it's 7200 (seconds=2 hours) Try:
echo "120" > /proc/sys/net/ipv4/tcp_keepalive_time
Also check if the client uses KeepAlive and see if sshd_config has "KeepAlive yes"
It is a little different in SCO but was set to 7200 as you mentioned. Just for anyone else using SCO, it is called tcp_keepidle and found in /etc/default/inet. I found you are supposed to change this setting using a program called inconfig and not modify the file directly. I found that about 20 minutes ago. I've changed it, just rebooted my box, and am testing it now. I'll let you know what I find out. It looks promosing by the looks of it. Hopefully that will do it.
Ok. Got it all figured out and working about as good as I want. First I changed the tcp_keepidle setting down to 300(5 minutes), the minimum SCO allows. This forces the tcp_keepalives to not even start till after 5 minutes. Then I modified the tcp_keepintrvl setting to 10. This starts the sending of a keepalive out ever 10 seconds after the previous mentioned 5 minutes is reached. The tcp_nkeep setting is at 8 which I left alone. This setting tells the tcp to only send 8 keepalives at the tcp_keepintrvl after the tcp_keepidle time is reached. So now my ssh command gives up and dies approximately 6.5 minutes instead of the 2 hours it was taking before. This suits my needs.
Thanks for all the moral support everyone. Hopefully this will help someone else along the way.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.