[nflug] Kill ports
Franklin Kumro Jr
fkumro at gmail.com
Fri Aug 31 21:04:24 EDT 2007
Sorry for asking such a broad question, Ken you hit the nail on the
head with lsof :) Thanks!
On 8/31/07, Ken Smith <kensmith at cse.buffalo.edu> wrote:
> On Fri, 2007-08-31 at 19:32 -0400, Franklin Kumro Jr wrote:
> > Is there anyway I could kill all the connections for a specific port
> > to my machine?
>
> Not quite sure what you mean by that. Do you mean set up your machine
> so it won't accept connections on that port (firewall it)? Or do you
> mean kill any/all processes currently attached to that port but
> otherwise leave your machine as-is?
>
> Or do you mean something else? :-)
>
> I'm guessing you mean that second one, and if that's the case all I can
> think of is using lsof(1) to find out what local processes have that
> port open and killing them. Figuring out the syntax to do that isn't
> particularly intuitive, it would be something like this (run as root) to
> see all the processes on your system that have port 22 open:
>
> lsof -i :22
>
> (you need to specify that it's Internet "files" you want information and
> you're specifying the address as "any IP address, port number 22").
>
> --
> Ken Smith
> - From there to here, from here to | kensmith at cse.buffalo.edu
> there, funny things are everywhere. |
> - Theodore Geisel |
>
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>
--
Frank
Shenanigans!!
I do the voodoo that I do do with sudo!
http://www.drunkenfrog.com
More information about the nflug
mailing list