LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-05-2006, 09:15 AM   #1
yuvalbm
LQ Newbie
 
Registered: Jul 2006
Posts: 2

Rep: Reputation: 0
how to kill tcp connection that nothing is going on the socket


I'm using Linux RHAS 3 u4.
I change tcp paramters to the follow:
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_time = 10


Still when open a telnet sasion it not stop by itself after the 35 seconds I supposed it will heppan.

Any ideas?
 
Old 11-05-2006, 11:03 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
keepalive deals with how long WAIT states stay alive. They do not (thank God!) kill active sessions. If you want a telnet session to die due to inactivity after it is established then you should probably investigate shell timeouts. (e.g. TMOUT=1800 would be a 30 minute timeout.) These timeouts are sometimes put in place to keep people from staying logged in long after they want finished the task for which they logged in.

The benefit being mainly for security - someone walking by a workstation left logged in as root can easily do a lot of damage - if the session timed out however it reduces the likelihood of this. Of course it also frees up ptys. Note that shell timeouts only do it if someone stays at the shell prompt. If they start an application it won't time that out (unless it is started in background without a nohup) so will not timeout the shell itself.
 
Old 11-06-2006, 01:43 AM   #3
yuvalbm
LQ Newbie
 
Registered: Jul 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlightner
keepalive deals with how long WAIT states stay alive. They do not (thank God!) kill active sessions. If you want a telnet session to die due to inactivity after it is established then you should probably investigate shell timeouts. (e.g. TMOUT=1800 would be a 30 minute timeout.) These timeouts are sometimes put in place to keep people from staying logged in long after they want finished the task for which they logged in.

The benefit being mainly for security - someone walking by a workstation left logged in as root can easily do a lot of damage - if the session timed out however it reduces the likelihood of this. Of course it also frees up ptys. Note that shell timeouts only do it if someone stays at the shell prompt. If they start an application it won't time that out (unless it is started in background without a nohup) so will not timeout the shell itself.
How do I change this TMOUT ?
 
Old 11-07-2006, 07:32 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Add it to /etc/profile and/or /etc/bashrc for global change (all users) or to .profile or .bashrc for indvidual user in the user's home directory. (bashrc used only for the bash shell, profile is used for sh and ksh.)

TMOUT=<#seconds>;export TMOUT
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to kill active TCP connections ~=gr3p=~ Linux - Networking 2 02-11-2006 09:58 AM
connection between java socket and unix socket sathishkumar Programming 1 01-10-2006 03:21 PM
Linux TCP Socket swa_dur Linux - Networking 3 09-23-2005 11:03 AM
how to force kill TCP connections minil Programming 3 04-19-2005 06:04 AM
tcp socket monitoring xuttux Linux - Networking 1 05-19-2004 08:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration