Operating System - Linux
1829816 Members
1762 Online
109993 Solutions
New Discussion

Linux server disconnects inactive telnet sessions

 
Debbie Fleith
Regular Advisor

Linux server disconnects inactive telnet sessions

Is there a setting that can stop the server (or prolong it) from disconnecting telnet sessions automatically after a period of inactivity?

8 REPLIES 8
Craig Kelley
Valued Contributor

Re: Linux server disconnects inactive telnet sessions

It's probably your shell that is hanging up, not the telnet server. Try running 'bash' after logging in and see if it still disconnects you.
Kodjo Agbenu
Honored Contributor

Re: Linux server disconnects inactive telnet sessions

Hello,

Check the shell TMOUT variable.

export TMOUT=120

will disconnect your session after 120 seconds of inactivity.

Good luck.

Kodjo
Learn and explain...
Debbie Fleith
Regular Advisor

Re: Linux server disconnects inactive telnet sessions

Does the TMOUT variable exist for both /bin/sh and /bin/bash?

What does it default to if not explicitly set with the profile?
U.SivaKumar_2
Honored Contributor

Re: Linux server disconnects inactive telnet sessions

Hi,
Yes it exists.
#vi /etc/profile
put this line
TMOUT=0
Now logout and login again. Now the session will never timeout for any user in the server after login.

Now if you want to Increase the timeout of
telnet session , before logging in the server.
( you might have seen that if you keep the telnet session open without giving login name
and password it will disconnect after some time) do this.
#vi /etc/login.defs
LOGIN_TIMEOUT 1000
1000 - seconds

regards,
U.SivaKumar
Innovations are made when conventions are broken
I_M
Honored Contributor

Re: Linux server disconnects inactive telnet sessions

Hi

Check if /bin/bash = /bin/sh.

On my system, /bin/sh link to /bin/bash.

So both of them have TMOUT.

regards,

Steven E. Protter
Exalted Contributor

Re: Linux server disconnects inactive telnet sessions

Its a security risk to set the timeout to zero.

The Linux default for Red Hat 7x is 180 seconds(15 minutes). That is reasonable.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
J._1
Advisor

Re: Linux server disconnects inactive telnet sessions

add:
set autologout=0

to your .login file
The faster you run, the faster you're done.
Steven E. Protter
Exalted Contributor

Re: Linux server disconnects inactive telnet sessions

Correction: 180 seconds is 3 minutes. 1800 seconds is 15 minutes. That's more appropriate.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com