Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Linux (RHEL), we are able to get a ForeignAddress/PID pair with "netstat -ntp" command:

[root@rhel ~]# netstat -ntp
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name

tcp        0      0             ESTABLISHED 15255/smbd
tcp        0      0 ::ffff:       ::ffff:     ESTABLISHED 27970/sshd: james [pri   
tcp        0    148 ::ffff:       ::ffff:     ESTABLISHED 27937/3

For example, for the user james above, we have & 27970.

Is it somehow possible to get the same information (ForeignAddress/PID) in AIX 5.3?

share|improve this question

If you have the AIX toolboox for linux apps, you could use lsof it should help, something like:

host:/:$ lsof -i :22 

sshd     1953   root    3u  IPv4 300864051      0t0  TCP *:ssh (LISTEN)
sshd     1953   root    4u  IPv6 300864053      0t0  TCP *:ssh (LISTEN)
sshd    19753   root    3u  IPv4 366276287      0t0  TCP XXX.XXX.XXX.XXX:ssh->XXX.XXX.XXX.XXX:54371 (ESTABLISHED)
sshd    19755 user    3u  IPv4 366276287      0t0  TCP XXX.XXX.XXX.XXX:ssh->XXX.XXX.XXX.XXX:54371 (ESTABLISHED)


This way you'l see who's listening at port 22 and who's connected to it.

Using AIX's native tools I think it's bit trickier and imo less helpful than lsof:

# netstat -Aan |grep <port_to_match>
<hex_number> tcp        0      0  *.XXX            *.*                LISTEN

# rmsock <hex_number> tcpcb
The socket <hex_number> is being held by proccess XXX (process_name).

# ps -ef |grep XXX
    user  XXX  YYY   0   Aug 03      -   /your/process

Hope it's of any help.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.