> -----Original Message-----
> From: Raf [mailto:turiel at Redbrick.DCU.ie]
> Sent: 27 October 2000 13:07
> To: ilug at linux.ie>> Anyone know how to change the amount of time it takes before a tcpip
> (i.e. telnet) connection times out? ATM its taking about 13
> minutes... I'd like to change it to something like 3-5 instead.
If a telnet client is directly connected to the telnetd then as long as
both parties both parties (processes) are running the connection will
never be disconnected by TCP/IP no matter how long the idle time.
The disconnection after idle timeouts are usually controlled from the
daemons in a client server setup, as is usually done by all FTP daemons.
However this isn't valid really for telnet as the user could run a command
which could take any amount of time, and therefore the telnetd can't and
doesn't have an idle timeout option. (If if did you would specify it on the
command line in /etc/inetd.conf or a seperate config file like
Therefore the process which knows about what processes are running etc. is
login shell and this can be set to timeout after a certain time. In bash you
the TMOUT variable or if you want to set it system wide edit /etc/bash. This
wait the timeout after displaying the primary shell for input before
however will terminate any processes you've running in the background
to stop this happening you need to use the nohup command. Related to this
you start a foreground process which you realise is going to take ages, and
don't want to restart it in the background, you can log in again and use
to detach the process from it's terminal, and you can nohup it so it won't
terminate when you log out. Any output from a nohup process is emailed to
Note also by default telnetd enables the TCP keep-alive mechanism (unless -n
specified) to probe connections that have been idle for some period of time
determine if the client is still there, so that idle connections from
that have crashed or can no longer be reached may be cleaned up. Note
the TCP keepalive timeout is system wide and not configurable for each
And also the default timeout is around 90 minutes. This mechanism is only
cleaning up stale sockets, and so is not breaking your connections.
You haven't said what's between your telnet client and server. This is
where the problem is? as firewalls will tend to break connections after
I think when using ip-masquerade the default idle timeout for TCP Sessions
mins. Also if you're going over an external firewall, this will have to be
configured to not drop telnet sessions.
If you use the command `ipchains -M -L` you can see how much time you have
on any open sessions before they get disconnected, and you can use the
`ipchains -M -S x y z` where x y and z are the number of seconds for the new
timeouts. Note y & z are not used for "normal" TCP connections so leave
at the default values.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!