how to kill tcp connection that nothing is going on the socket
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.