1833783 Members
2326 Online
110063 Solutions
New Discussion

telnet

 
SOLVED
Go to solution
Wang Xueyan
Advisor

telnet

In our system, users have to telnet to the server to use our application. Many of them never exit when they left. That affect the server's performance. Is there any way to kill these idle telnetd or shell automatically?
6 REPLIES 6
T G Manikandan
Honored Contributor
Solution

Re: telnet

if the user default shell is ksh and sh you can use the /etc/profile
TMOUT=600(value in sec)



If their shell is csh
then

make entries in /etc/csh.login

set autologout=60(value in min)



Thanks
Michael Tully
Honored Contributor

Re: telnet

The most used method is to set up either via the users .profile file a 'TMOUT=3600' or some or other time variant. The value is in seconds. Here is a snipet from the 'ksh' man page

TMOUT If set to a value greater than zero, the read built-in command terminates after TMOUTseconds when input is from a terminal. Otherwise, the shell will terminate if a line is not entered within the prescribed number of seconds while reading from a terminal. (Note that the shell can be compiled with a maximum bound for this value which cannot be exceeded.)
Anyone for a Mutiny ?
Ravi_8
Honored Contributor

Re: telnet

Hi,

since those ppid will be set to 1, killing those processes wouldn't help. they vanish after a reboot. To avoid these follow the making entries as posted by Manikandan
never give up
Michael Tully
Honored Contributor

Re: telnet

Beware of setting the TMOUT variable in /etc/profile. Doing this sets a basically a system wide variable for all users. The best way is to utilise the TMOUT function is via skeleton .profile with the variable instead.
You can create a skeleton .csh.login file for 'csh' users as well if required.
Anyone for a Mutiny ?
Steven E. Protter
Exalted Contributor

Re: telnet

TMEOUT won't work in some telnet applicatoins.

We use software AG natural and even if the user has timed out of the database natural doesn't time them out.

So I've had to write a custom program that does the following:

It reads the telnet user and checks a database utility for a login. If there is a match, it leaves them alone. If there is no match it nukes the pid of the natural session.

Sometimes you have to write your own tool to do the job.

P
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
Wang Xueyan
Advisor

Re: telnet

I got it. Thank you.