Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get the process id that is using a port

335 views
Skip to first unread message

Tristan

unread,
Dec 11, 2008, 1:21:29 AM12/11/08
to
I have no root privilege. how could i find the process id that is
using a port.

Or, could I get the username who is using a port?

michael.guirimand

unread,
Dec 11, 2008, 2:17:42 AM12/11/08
to
Hi Tristan,

You can use lsof command for that.
"lsof -i" and you will see all processid how 're using your sockets.

man page: http://www.netadmintools.com/html/lsof.man.html

Regards.

Tristan

unread,
Dec 11, 2008, 2:32:20 AM12/11/08
to
Michael,

Thanks.
I've tried lsof but failed.

>lsof
lsof: cannot open /dev/kmem
lsof: kvm_open(namelist=default, corefile=default): Permission denied

It seems that I have no permission to lsof, since i am not root.


Thanks,
Tristan

On Dec 11, 3:17 pm, "michael.guirimand" <michael.guirim...@gmail.com>
wrote:

> > Or, could I get the username who is using a port?- Hide quoted text -
>
> - Show quoted text -

michael.guirimand

unread,
Dec 11, 2008, 2:55:54 AM12/11/08
to
Bad news...Sorry,
maybe your Unix Administrator doesn't give at your user or your users
group the right to read /dev/kmem

http://gd.tuwien.ac.at/utils/admin-tools/lsof/FAQ

17.15 Why does lsof say, "kvm_open(namelist=default, core=default):
Permission denied?"

Lsof needs permission to read from the /dev/kmem and /dev/mem
memory devices. Access to them is opened via a call to
the kvm_open() library function and it reports the indicated
message.

You must give lsof permission to read the memory devices.
The super user can almost always do that, but other lsof
users can do it if some group -- e.g., sys -- has permission
to read the memory devices, and the lsof binary is installed
with the group's ownership and with the setgid permission
bit enabled.

Thomas Glanzmann

unread,
Dec 11, 2008, 3:19:39 AM12/11/08
to
Hello,

> lsof: cannot open /dev/kmem

you have to run it as root. And use the following command line for lsof
to identify a process that is listening:

lsof -P -i -n

Thomas

Roland Titze

unread,
Dec 16, 2008, 9:53:45 AM12/16/08
to
On 11 Dez., 09:19, Thomas Glanzmann <sithg...@stud.uni-erlangen.de>
wrote:

AFAIK lsof doesn't work correctly on Solaris 10.
I would prefer pcp on Solaris 10 which is available at

http://www.unix.ms/pcp/

BR
--
Roland

0 new messages