I would like to write a script to secure Solaris 11 servers in preparation for internet access.
In addition to enabling ipfilter
, I would like to disable network-accessible services that are not used. This should reduce the number of processes shown in ps
, and also seems cleaner than relying solely on ipfilter
.
Is there a way I can find out what processes or services are currently listening / responsible for open ports on the server? I would need to filter out those that only listen to localhost
. I would want to see those that are listening for UDP as well as TCP. If I can get a process ID, or svcs
name, that would be great!
Once I have a list, I can configure each one as needed, such as restricting sshd
, disabling sendmail
, and similar operations for the other services I find on this list.
So how can I get a list?