Ssh session connection problem

Hi ,

I am facing one problem with one of my current ISP i.e. WorldCall , and get PTCL broadband installed today to address the issue. Though I will be running both for comparison for some time before making a final decision.

Now coming to the problem , on WorldCall my ssh sessions to remote linux servers break after some time , like in 5 or 10 min, to have a continues connection I have to run some command in shell to keep it active , e.g. a 'top' command running etc.

This was not a problem when I was on Micronet back in ISB. ( in Karachi from some time now)

I have not asked WorldCall support for this, as I really don't think they will even understand what I am talking about , based on the customer service I get from them.

Any one know if this can be resolved at my end ? I mean may be with some modem setting ? (I have Scientific Atlanta wireless modem from WorldCall).

hmm no (linux + worldcall) users around , that may verify the behaviour ? mean if they facing same issue or not ?

I am using WC and I don't have any major problem with using SSH. I have tried it on many different servers and it always works. I don't face disconnection if the connection is idle for a short duration.

I will admit that often there is a lot of lag. If you feel that during a connection you don't have a response you should try hitting enter repeatedly to bring the connection alive.

Have you tried setting up public key encryption? That way reconnecting is easy and you don't have to keep a connection open all the time.

You could also try a different server. Its possible it may be a server issue.

[quote=", post:, topic:"]

Hi ,

Now coming to the problem , on WorldCall my ssh sessions to remote linux servers break after some time , like in 5 or 10 min, to have a continues connection I have to run some command in shell to keep it active , e.g. a ‘top’ command running etc.


This is most likely due to some firewall setting at your ISP. (or in some cases with server)

Simply speaking, ISP/Server will terminate the inactive session after a certain time.

The way around this issue would be that you edit your ssh configuration on server.

I have Centos on my server and that’s what I did to overcome this problem.

Edit /etc/ssh/ssh_config and add (or remove # sign if those line are already there)

TCPKeepAlive yes

ServerAliveInterval 60

Add the following lines to the ~/.ssh/config file (create if it doesn’t exist)

Host *

ServerAliveInterval 60

(There is a space at the start of 2nd line)

well Man I think its the SSHd config setting for idle session time out .... increase its value for more then 60 Min then there will be not DC problem ;)


Thanks for the replies guys.

@rokra , can you please confirm which modem you are using with your world call connection ? I have the scientific atlantia wirelss modem , and had wired modem earlier many months ago , and as far as I remember this teimout was lot greater than current one.

I have not tried public key enctyption , I will see if it helps. (not a server issue though, as there are few hundred, same behaviour on all)


Yes I think its some firewall at ISP or Modem , changing ssh config is not easy/practical for me as I connect to round 20-30 servers daily and there few hundred in total, bieng accessed by other team meates too from over the world.

Also main because on WorldCall session timeouts after around 10 min , on Wateen it timeouts around 20 min or so , and on this new PTCL connection it didnt timeout for atleast 2 hours, and i.e. on same servers , so due to this from the possible reasons I am excluding ssh config.


After testing the session live time with PTCL connection (that is atleast two hours with no activity on connected ssh session or even my laptop in general ) , I am able to exclude any ssh config side possible problem.

once again thanks for suggestions. I guess its ISP end or the modem , though I am not seeing any modem config that should affect it. rokra if you can confirm me your modem you are using with worldcall that will help me narrow down the problem. Thanks.

My modem is a wired scientific atlanta webstar dpc2100r2 series modem.

Regarding public key encryption, it will not solve your problem of disconnection but it will make reconnecting to servers easier. Once setup, connecting to a server is as easy as clicking on the putty icon. You won't have to enter a password everytime.

However its a lot easier to setup key based login on one server rather than on a hundred servers :). Probably not worth the hassle if you only occasionally login to most of them.

Thanks for the info rokra. It could be the wireless router then , as the disconnections have been painful for me. Got a wireles router for the new ptcl connection and now connectiosn no more break, so finally looks like problem is resolved for me.

Also I have not spend more time on figuring this out on WorldCall , because even if this ssh problem is resolved , they going out with load shedding is something which is still there and this is something they can not do anything about, they blame too much load shedding the problem, but this is how our country is, so if I can have a UPS for my home , they should have better ones for their equipement, as they have some but the backup time is not good enough. oh I should stop here I think , else this venting for WC due to the frustrations they caused will be too long :).

Actually I work from home and login to many of them , many times a day, so I use SecureCRT , which saves the sessiosn for me with all IP/pass info , so its matter of clicking the sessions.

I like putty for its interface , can start using it when they start providing the option to save sessions, for now SecureCRT for the win.