If I don't use the router, I can easily connect to my computer using SSH and the connection still is active after being idle for an hour, which should be normal when you log in remotely.
With the router, I told it to redirect incoming requests to port 22 to my desktop, which works actually. HOWEVER, the router not only kills connections that has been idle for just a few minutes, but also rejects further requests from the same IP for a long time! So I now have a bash script:
#! /bin/bashOnce I finish something in SSH, I run this script. It sends several bytes every ten seconds so that the router won't consider the connection idle... I'm wondering what better workaround I can use (other than disconnecting frequently...)? I'm almost sure the router can't be configured so that it allows a connection to be idle for a long time..
until read -t10; do
date
done
[Update Oct 26: A better solution may be sending null bytes periodically, like what PuTTY does. This is usually called "anti-idle".]
A similar problem happened when I was transferring files from my laptop to my desktop (both connected to LAN ports of the router) with SCP. I issued SCP commands about ten times in several minutes, and further connections were rejected too. Is it possible to be again the router's fault? (SSH daemon had no reason to do so, I think.)
No comments:
Post a Comment