From: Tristan on
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?
From: michael.guirimand on
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.


On 11 déc, 07:21, Tristan <sooq...(a)gmail.com> wrote:
> 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?

From: Tristan on
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...(a)gmail.com>
wrote:
> 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.
>
> On 11 déc, 07:21, Tristan <sooq...(a)gmail.com> wrote:
>
>
>
> > 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?- Hide quoted text -
>
> - Show quoted text -

From: michael.guirimand on
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.
From: Thomas Glanzmann on
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