|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
determining open ports
hi all
1) how to determine available ports in a box (solaris) do i have to go for a netstat on all the ports? 2) how to block a particular port for a particular type of connection. Any help would be greatly appreciated Thanks |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
As far as checking ports and their usage, netstat and lsof (which you may need to d/l, compile and install if not present) are the commands for you.
netstat -an | grep "\.389.*LISTEN" Will show you if LDAP is Listening, for example. You can refine the grep to extract the exact results you want. Cheers ZB |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
thanks for the reply
i believe lsof command uses the following file /dev/kmem on the stranger part i tried on server1 - it was working fine and i could all the information that i needed and when i tried it on server2 - it was showing permission denied i checked the permissions for the file on either of the servers and it was the same could you please explain why its show different behaviour. I do need one more clarification. Ports indicating LISTEN status are the ones picked by the process and opened to accept connections right? There is no list of acceptable ports which could hereby be opened and connected. I think i am making myself clear. Kindly revert if i had to explain my question in detail. Thanks |
|
#4
|
|||
|
|||
|
edit your /etc/services file you will see all ports and which ones you can close
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
thanks for the reply
i believe we can have only the list of ports registered in /etc/services i dont think we can get a list of ports that are blocked or prevented from connecting from any of the requests can u please clarify on this. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
As always I am a bit lost here.
Port starts from 0 (or 1 I don't remember) all the way up to 32555 (or sth similar). A port allocated by an active process (either serve or client) can be found by netstat. Everything else is not being used and so "available" for a process to allocate. /etc/services is a differenet thing which may have implication for inetd or xinetd only. A port does not have to be "registered" in this file to be used by a process which has nothing to do with inetd. There are more than one approaches to block a port. Conventional approach is via tcpwrapper. Now, people are more likely using (soft- or hardware based) firewall such as iptables in Linux. I hope it answered all of your questions. |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Quote:
]$ nmap -p 1-$MAX_PORTS Quote:
|
| Sponsored Links | ||
|
![]() |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open/close of ports | balamv | IP Networking | 1 | 05-06-2011 12:54 PM |
| open ports and services | lhareigh890 | UNIX for Dummies Questions & Answers | 1 | 12-13-2010 10:02 PM |
| Help determining what's blocking ports | brandonros | IP Networking | 11 | 01-11-2009 06:58 PM |
| open ports solaris 8 | csgonan | Solaris | 1 | 12-03-2008 11:24 AM |
| How To Open Ports in RedHat ? | Sirius | Linux | 7 | 09-06-2003 08:48 AM |
|
|