List TCP ports with process


 
Thread Tools Search this Thread
Operating Systems Solaris List TCP ports with process
# 8  
Old 10-30-2008
Yep,
this is a good option. Another one, based on your idea:

Code:
pfiles /proc/* 2>&- | 
  nawk 'END {
  if (f) print p 
    }
/^[0-9]/ { 
    if (f) print p, RS 
    p = $0
    f = 0
  }
/INET / {
  sub(/.*INET/,"") 
  p = p ? p RS $0 : $0
  f = 1 
  }'


Last edited by radoulov; 10-30-2008 at 01:41 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do i list running process with the ports they are using?

How do i list the running process and also view the ports they are listening to at the same time? (3 Replies)
Discussion started by: mena
3 Replies

2. UNIX for Advanced & Expert Users

How to list process connected to tcp port?

Hey guys, I need to kill the process that is currently connected to port 10540. I'm on HP-UX machine. Below is the result of my netstat. $ netstat -an |grep 10540 tcp 0 0 129.0.0.1.10540 *.* LISTEN We don't have lsof command, but we have fuser. ... (3 Replies)
Discussion started by: brichigo
3 Replies

3. UNIX for Dummies Questions & Answers

Opening TCP ports

I'm not sure if this is the right place for this post, but I'd be grateful if somebody could please help me. I'm trying to open ports 999, 1982 and 1983 but am not having much luck. I used iptables -A INPUT -i eth0 -p tcp --sport 999 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i... (2 Replies)
Discussion started by: thehaapyappy
2 Replies

4. UNIX for Advanced & Expert Users

TCP slow access though certain ports

hi, I'm currently running with an issue whereby we are experiencing very poor access speeds to our Informix database. Connections or requests to the DB are taking in excess of 2/3/4 minutes during peek periods during the day. This has only just started to happen but so far we have been unable to... (0 Replies)
Discussion started by: fastyan
0 Replies

5. Windows & DOS: Issues & Discussions

TCP ports and file sharing

In using a music file sharing program (WinMx), I am told that I cannot make a primary connection (fastest downloads) because I do not have a TCP and UDP port. I am running Windows Me.What do I do? Thanks. (6 Replies)
Discussion started by: dookster5
6 Replies

6. UNIX for Advanced & Expert Users

TCP ports - TIME_WAIT

What is the maximum number of TCP ports that can be consumed at any one time? How can I determine what the number is or increase it? I was under the impression that with our system (UnixWare 7.1.1) 1024 was the maximum under our current Kernel tuning parms, but I think that is really just... (4 Replies)
Discussion started by: dlkox
4 Replies

7. IP Networking

TCP/UDP Ports

Just wondering if anyone knows of any good on-line documentation on TCP/UDP Ports. Basically i want to know how to check if they are in use, learn how to close them, etc... Thanks... (5 Replies)
Discussion started by: eugene_mayo
5 Replies

8. UNIX for Dummies Questions & Answers

TCP/UDP Ports

Just starting to work with unix, wondering if there is any good on-line documentation explaining TCP/UDP ports, how to use them, etc... Thanks.... (1 Reply)
Discussion started by: eugene_mayo
1 Replies

9. UNIX for Dummies Questions & Answers

TCP Listening Ports

Hello all, Can someone instruct me on how to change the listening port for ftp ( or any tcp service) from 21 to another port number? Thanks in advance.. -AJ (3 Replies)
Discussion started by: jacobsa
3 Replies

10. IP Networking

TCP Ports

We are being setup with a client over their VPN to support them remotely. We are unable to access their VPN through our server, they said to look and make sure that the TCP ports are enabled for their security setup (ports are in the 4000 range). How do you look for this and how do you enable a... (3 Replies)
Discussion started by: blacksheep
3 Replies
Login or Register to Ask a Question
AA-UNCONFINED(8)						     AppArmor							  AA-UNCONFINED(8)

NAME
aa-unconfined - output a list of processes with tcp or udp ports that do not have AppArmor profiles loaded SYNOPSIS
aa-unconfined DESCRIPTION
aa-unconfined will use netstat(8) to determine which processes have open network sockets and do not have AppArmor profiles loaded into the kernel. BUGS
aa-unconfined must be run as root to retrieve the process executable link from the /proc filesystem. This program is susceptible to race conditions of several flavours: an unlinked executable will be mishandled; an executable started before a AppArmor profile is loaded will not appear in the output, despite running without confinement; a process that dies between the netstat(8) and further checks will be mishandled. This program only lists processes using TCP and UDP. In short, this program is unsuitable for forensics use and is provided only as an aid to profiling all network-accessible processes in the lab. If you find any bugs, please report them at <http://https://bugs.launchpad.net/apparmor/+filebug>. SEE ALSO
netstat(8), apparmor(7), apparmor.d(5), aa_change_hat(2), and <http://wiki.apparmor.net>. AppArmor 2.7.103 2012-06-28 AA-UNCONFINED(8)