Operating System - HP-UX
1833875 Members
1442 Online
110063 Solutions
New Discussion

Re: The port on my server

 
SOLVED
Go to solution
Mousa55
Super Advisor

The port on my server

Hi
how i can find all port opened on my server
HP-UX (rp8420 11i)

thanks
12 REPLIES 12
Pete Randall
Outstanding Contributor

Re: The port on my server

Use lsof. If you don't have it, get it here:

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.78/


Pete

Pete
Mousa55
Super Advisor

Re: The port on my server

Hi
i am installed but the command not work

# lsof
/usr/bin/ksh: lsof: not found

Note i am installed under " /usr/local "

thanks
Anshumali
Esteemed Contributor

Re: The port on my server

Security for root... "." isnt current profile...

try with ./lsof
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Anshumali
Esteemed Contributor

Re: The port on my server

Moreever you can use nmap as well for checking out the ports opened on your server. Try Google for nmap.

Cheers!
Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Zeev Schultz
Honored Contributor
Solution

Re: The port on my server

Well,basically you can use :

"netstat -an | grep "LISTEN" shows ports that LISTEN to incoming connection

"netstat -an | grep "EST" will show established (active) connections
So computers don't think yet. At least not chess computers. - Seymour Cray
Mousa55
Super Advisor

Re: The port on my server

Hi
the same problem, and i am root user
and i can see the command from man page
>man lsof
thanks
Anshumali
Esteemed Contributor

Re: The port on my server

Do as below...
cd /usr/local
ls -ltr lsof
./lsof

and post the results of all above.

Thanks,
Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Dennis Handly
Acclaimed Contributor

Re: The port on my server

>i am installed but the command not work
# lsof
/usr/bin/ksh: lsof: not found
>Note i am installed under "/usr/local"

This doesn't mean it doesn't work. It means you didn't find it. You could use the absolute path: /usr/local/bin/lsof
Mousa55
Super Advisor

Re: The port on my server

Hi
# cd /usr/local
# ll
total 528
lrwxr-xr-x 1 root sys 28 Nov 14 15:31 CAlib -> /opt/CA/SharedComponents/lib
drwxrwxr-x 2 bin bin 8192 Dec 31 14:42 bin
drwxr-xr-x 4 root sys 96 Dec 31 14:42 doc
drwxrwxr-x 2 bin bin 96 Aug 22 2006 etc
drwxrwxr-x 2 bin bin 96 Aug 22 2006 games
drwxrwxr-x 2 bin bin 96 Dec 2 10:40 lib
-rw-r----- 1 root sys 256000 Dec 31 14:27 lsof-4.78-hppa-11.11.depot
drwxrwxr-x 3 bin bin 96 Dec 31 14:42 man
# ls -ltr lsof
lsof not found
thanks
Anshumali
Esteemed Contributor

Re: The port on my server

check in bin.
./lsof

Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Bill Hassell
Honored Contributor

Re: The port on my server

It does not matter what directory you are in. Typing lsof requires that the full path for this command is one of the paths shown in $PATH. If not, the command will not be found. If lsof is actually installed on your system, start with the common locations:

find /usr/local /usr/contrib /opt -name lsof

Then you type the fullpath to the command:

/usr/local/bin/lsof

Or you change the file: /etc/PATH to add /usr/local/bin (or whatever is needed) so that the fullpath can be found.


Bill Hassell, sysadmin
Mousa55
Super Advisor

Re: The port on my server

thanks for all