Fixing Bad SSH Connections? 10
Pilchie asks: "I often use SSH to access my computer at home, when I am either at work or at school. My problem is that I can't seem to make the connection persistent. I connect, and usually within about 30 minutes, all my Xterms are frozen, and I have to kill my SSH client and start again, which is annoying when I am coding something. My question is twofold. First, how to determine if it is something to do with SSH Client or Server, or whether it is my ISP's network which sucks? Second, Is there anything I can do about it?
"Here's a description of my system:
- Home machine: P166, 128MB RAM, running Debian Potato.
- SSH Server 1.2.27
- Remote Machine: PIII 450, 256MB RAM, running NT 4.0.
- SSH Client the windows one by Cedomir Igaly Rev 2.112, with Exceed as XServer
- Net connection: Cable Modem from Rogers@Home (Brampton Canada, near Toronto) (Note: It is one of the new Terayonones which doesn't have an IP address, uses DHCP and SNMP)
Lastly, two pieces of information that I think might be key. First, if I traceroute to my home machine just after the connection dies, I get to the gateway machine for my ISP subnet, but not to my machine. Second, when I used to do this from school a few months ago, on a Solaris 2.7 box, I would often have problems connecting, with the same thing happening with traceroute. However, once I got connected it usually worked fine.
Any ideas, anyone?"
Duh (Score:1)
-----
If my facts are wrong then tell me. I don't mind.
A possible reason and solution (Score:3)
Solution to same problem. (Score:3)
My solution was just doing
That would increase the keepalive time, thus stop the disconnects. Ever since I've done that I've never had a problem again.
Depending on your version of bash you might not be able to do
You want 300 without a line break so you might have to do
/bin/echo "300\c"
This should help you and all others who have this problem.
unset autologout / DHCP (Score:1)
Oh, I guess that's another thing - how often does DHCP/pump(?) change your IP address? If that changes regularly (which it's allowed to do) then ssh would hang...
IPchains solution ? (Score:2)
Re: Smells like Rogers tech support to me =) (Score:1)
In this light, I think you'd make a great Sympatico/Rogers call center clerk.. a supervisor even.
probably not a ssh prob (Score:1)
sounds like a crappy rogers cable connection. When you are at home do you ever notice short outages of net access? From what I've seen it is quite common for cable modems to go offline for 30 seconds or more every hour, which could explain why your ssh's are locking up. I'm sure there is an option to lengthen the timeout time in ssh, read the man page.
hints (Score:2)
Do you pass a statefull firewall . ? (Score:1)
This might sound OK , but it also has a downfall:
as long as you are not typing , there is no traffic generated from your side. If you would pass for example a Checkpoint Firewall , the tcp timeout in the root checkpoint config will close the connection after the defined tcp timeout , usually 30 minutes. Even running a tunnel with X for example will not help as the tunnel traffic does not get counted ( I do not know why )
The work around we have created here is to start a script in the background that shows the date every 25 minutes, this the looks like you have a person typing in 'date' and keeps the tcp session up and running
Hope this helps
D.
The easy way.. (Score:2)
I usually use joe, it updates the screen every minute because it has a clock in the title. Besides, having an editor open never hurts, right?
Since I do most of my work in screen, ^Ac joe has become a rather standard procedure for me.