Killing host connection


 
Thread Tools Search this Thread
Operating Systems Linux Debian Killing host connection
# 1  
Old 03-26-2004
Killing host connection

Hi All
Is there a command (or set of commands) that can be used to kill a connection listed in the netstat table? Say there is a host connected to a certain port on your machine, and it is listed via a 'netstat -an', is there a way to issue some commands to 'disconnect' or kill that connection?

I know in HP-UX this can be performed with the ndd command, but how about Linux?

I am using Debian woody kernel 2.4.22.

Thanks!
# 2  
Old 03-26-2004
.....

Last edited by druuna; 05-21-2009 at 10:13 AM..
druuna
# 3  
Old 03-26-2004
Knowing the pid won't help if the connection is in FINWAIT2.
# 4  
Old 03-26-2004
.....

Last edited by druuna; 05-21-2009 at 10:13 AM..
druuna
# 5  
Old 03-26-2004
Quote:
Originally posted by druuna
True.

But am I incorrect by stating that the connection is no longer active and the 'closing negotiations' are sent. Killing a connection in FINWAIT2 state seems pointless (to me, that is Smilie ).
Well, yeah but that's because you do things correctly. Smilie

People write servers that connect to pc's. The pc's are powered off. Then someone wants to kill and restart the server. Because connections are in FINWAIT2, the bind fails.

To get into this state they had to:
1. bypass inetd so that one global bind() is not performed at startup.

2. connect to clients that fail to do a proper shutdown.

3. write goofy code so that the server needs to be restarted

4. forget to set SO_REUSEADDR which would instruct the kernel to ignore the FINWAIT2 connections during a bind()

Believe or not, this happens all the time. Go figure. Many OS's will now time out FINWAIT2 connections which is not good. Other OS's have a way to manually close a FINWAIT2 connection. This is what I think the OP wants.
# 6  
Old 03-26-2004
.....

Last edited by druuna; 05-21-2009 at 10:14 AM..
druuna
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can i get the logged in host machine ip in a ssh connection?

Hi All, I have a basic question. In my system i maintained multiple unix server, and only one server has public ip, and all the servers are behind load balancing BIG ip server. To access any server, user need to access server with public IP then from there they can establish ssh connection to... (2 Replies)
Discussion started by: dilipsn
2 Replies

2. HP-UX

Connection closed by foreign host

I am trying to connect to my HP server from remote machine. It gets connected but once credential are provided the connection is closed. adroit:/home/seo/hitendra 32 ] telnet myserv1 Trying... Connected to myserv1. Escape character is '^]'. Local flow control on Telnet TERMINAL-SPEED... (4 Replies)
Discussion started by: hiten.r.chauhan
4 Replies

3. UNIX for Advanced & Expert Users

connecting through master ssh connection on intermediate host

Suppose host B does not allow public/private key authentication - only secureID authentication. I already have a master ssh connection from host A to host B. Host A does allow public/private key authentication. Is there any way to connect from host C to host B by way of the master ssh connection... (2 Replies)
Discussion started by: cpp6f
2 Replies

4. UNIX for Dummies Questions & Answers

ssh_exchange_identification: Connection closed by remote host Connection closed

Hi Everyone, Good day. Scenario: 2 unix servers -- A (SunOS) and B (AIX) I have an ftp script to sftp 30 files from A to B which happen almost instantaneously i.e 30 sftp's happen at the same time. Some of these sftp's fail with the following error: ssh_exchange_identification: Connection... (1 Reply)
Discussion started by: jeevan_fimare
1 Replies

5. Shell Programming and Scripting

check ssh connection to remote host

I am using KSH and I need to check whether the remote host has been configured with ssh public key. Is there any way we can check inside a script? (6 Replies)
Discussion started by: praveenbvarrier
6 Replies

6. Shell Programming and Scripting

ssh_exchange_identification: Connection closed by remote host

hi i am trying to connect the frontend server using ssh i got the following error ssh_exchange_identification: Connection closed by remote host can anyone help please (1 Reply)
Discussion started by: Satyak
1 Replies

7. IP Networking

FTP - Connection Closed By Remote Host

Hi, I am having a problem with our AIX 4.3.3 Server accessing FTP. The error is " Connection Closed By Remote Host". Scenario: Since i put a default gateway on the server FTP connection is having a problem but when i remove the default gateway it will works fine.. Is there any way not... (1 Reply)
Discussion started by: mouglybean
1 Replies

8. UNIX for Dummies Questions & Answers

Connection to host lost

I keep receiving this message when trying to connect using telnet to SunOS 5.8 running Solaris 8 from W2k. I checked system and inetd.conf and they seem to be ok. I can ping the host ok. ftp also works fine. Any suggestion would be greatly appreciated. (2 Replies)
Discussion started by: goose
2 Replies

9. UNIX for Dummies Questions & Answers

Not on System Console; Connection to host lost.

hi all, When I telnet my W2k machine to my Solaris8 machine, after typing my login name and password prompt, I get the following msg immediately. ==== Not on System Console. Connection to host lost. ==== The 2 machines are connected on the same kingston workgroup hub. Can someone pls help? (3 Replies)
Discussion started by: andrec
3 Replies

10. UNIX for Dummies Questions & Answers

connection to host lost

Hi all, I am connecting to a unix host from NT workstation via telnet. After working for around two hours I get the message "connection to host lost" What could the problem be? (1 Reply)
Discussion started by: nbiketi
1 Replies
Login or Register to Ask a Question