🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.os.linux.ubuntu
Article #48

Re: Port 4001 held open by squid proxy

#48
From: Zebee Johnstone
Date: Mon, 12 Dec 2011 20:56
56 lines
2932 bytes
In aus.computers.linux on Tue, 13 Dec 2011 05:49:37 +1100
Polly the Parrott <flatulantdingo@deadspam.com> wrote:
> Running Zenmap, shows
>
> "4001/tcp open http-proxy Squid webproxy"
>
> I need that port for another service.
>
> Not using squid, so I did a complete removal in Synaptic and rebooted.
>
> Zenmap still gave the same above results.
>
> Question is, how can I close that port so that it is available to the other 
> service?
>

By finding out what *really* has it open!

(Yes, this crusty old unix admin does not trust gui tools...)


sudo lsof -i -P 

what this does is give you the power of root (the sudo bit) to have
lsof (a very useful tool) list all the internet connections (the -i)
using port numbers (the -P)

(when sudo asks for a password it wants your password)

So have a look at that, looking for 4001 in the last column, the one
after TCP/UDP.
 (you can use grep to make it easy, sudo lsof -o -P | grep 4001 )

eg, on my box what's using port 5900 is this:

x11vnc     2635 zebee    9u  IPv4    16167      0t0  TCP *:5900 (LISTEN)

so that's the program x11vnc with the PID (process id) 2635 

if I do a process listing:
[zebee@hp Default]$ ps -ef | grep 2635
zebee     2635  2445  0 Nov11 ?        00:39:19 /usr/bin/x11vnc -display :0


Now.. using grep strips the headers but I know that the first number
is the PID of x11vnc and the 2nd is its parent

[zebee@hp Default]$ ps -ef | grep 2445
zebee     2445     1  0 Nov11 ?        00:00:00 kdeinit4: kdeinit4 Running...

Right... so x11vnc is run by kdeinit, so it's in my startup items.  

So use lsof -i -P to see what's using  port 4001, then the process
listing and grep to see just what's going on.

Zebee
Technical Details
Message-ID: <slrnjecqko.6d.zebeej@gmail.com>
Path: arc1-ca.pugleaf.net!lh20ni15260pbb.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!fu-berlin.de!news0.firedrake.org!not-for-mail
References: <9kn29kFrrmU1@mid.individual.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 102983,bab3725a8fcd2365
X-Google-NewGroupId: yes
X-Google-Attributes: gidcfc73a2246,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.68.213.71 with SMTP id nq7mr10341224pbc.2.1323723417501;
        Mon, 12 Dec 2011 12:56:57 -0800 (PST)
Path: arc1-ca.pugleaf.net!lh20ni15260pbb.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!fu-berlin.de!news0.firedrake.org!not-for-mail
From: Zebee Johnstone <zebeej@gmail.com>
Newsgroups: alt.os.linux.ubuntu,aus.computers.linux
Subject: Re: Port 4001 held open by squid proxy
Date: Mon, 12 Dec 2011 20:56:56 +0000 (UTC)
Organization: Firedrake Synthesis
Lines: 57
Message-ID: <slrnjecqko.6d.zebeej@gmail.com>
References: <9kn29kFrrmU1@mid.individual.net>
Reply-To: zebeej@gmail.com
NNTP-Posting-Host: 156.10.233.220.static.exetel.com.au
Mime-Version: 1.0
X-Trace: parhelion.firedrake.org 1323723416 17818 220.233.10.156 (12 Dec 2011 20:56:56 GMT)
X-Complaints-To: usenet@parhelion.firedrake.org
NNTP-Posting-Date: Mon, 12 Dec 2011 20:56:56 +0000 (UTC)
User-Agent: slrn/0.9.9p1 (Darwin)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit