- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to know process id of a listening port
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 09:55 AM
01-29-2019 09:55 AM
How to know process id of a listening port
Hi,
I want to kill the process that's listening on a port.
From several posts, the recommendations are use lsof. Unfortunately, I am not in a position to install anything.
netstat is one option, however, the flags recommended don't apply to our ux version (HP-UX HPDev B.11.31 U ia64) .
So, how would you know the owner of a given port?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 07:57 PM
01-29-2019 07:57 PM
Re: How to know process id of a listening port
> I want to kill the process that's listening on a port.
Which "a port"?
> From several posts, the recommendations are use lsof. [...]
Yup.
> [...] Unfortunately, I am not in a position to install anything.
Because? No foreign software any place, or what?
> netstat is one option, however, the flags recommended [...]
Which "the flags", "recommended" by whom? If you're looking at some
GNU/Linux program, then I wouldn't be amazed if the HP-UX program of the
same name were different/older/worse.
> So, how would you know the owner of a given port?
I'd install "lsof":
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.89/
But you might need to run it as "root" to get the results you seek.
For example:
dyi# uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license
dyi# su - sms
dyi $ /usr/local/src/lsof/lsof-4.89/lsof -i :22
dyi $ logout
logout root
dyi# /usr/local/src/lsof/lsof-4.89/lsof -i :22
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 889 root 4u IPv6 0xe00000014aa9e100 0t0 TCP *:22 (LISTEN)
sshd 889 root 5u IPv4 0xe00000014a36ad00 0t0 TCP *:22 (LISTEN)
dyi# ps -ef | grep ' 889 '
root 889 1 0 21:08:41 ? 0:00 /opt/ssh/sbin/sshd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2019 03:53 AM
01-30-2019 03:53 AM
Re: How to know process id of a listening port
Have a look at the pfiles command - that may help.
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2019 10:09 PM
07-14-2019 10:09 PM
Re: How to know process id of a listening port
The fuser(1M) command should help.
-k Send the SIGKILL signal to each process using each file.
You must have appropriate privileges to kill processes that
you do not own.
Ports (in place of file paths) can be specified with port number and protocol (tcp/udp) separated by a slash ('/'). So:
fuser -k 22/tcp
could kill sshd.
--
ranga