This content is submitted by a BigAdmin user. It has not been reviewed for technical accuracy by Sun Microsystems, though it may have been lightly edited to improve readability. If you find an error or would like to comment on the article, please contact the submitter or use the comment field at the bottom of the article.
Community submissions may not follow Sun trademark guidelines. For information on Sun trademarks, please see http://www.sun.com/suntrademarks/.
Configuring TCP Wrappers for the Solaris Operating System
Sivakanth Mundru, August, 2004
Last Updated September 07, 2004
Introduction
TCP Wrappers are used by Open Systems Administrators for two important features:
Provide access control to a host and service depending on the origin of the request.
Log both successful and unsuccessful connections to that host.
These instructions apply for the Solaris OS, versions 7, 8, and 9. The Solaris 8 OS doesn't have TCP wrappers built into the OS, while the Solaris 9 OS does; however, the procedure is applicable to both these versions of the OS. You would need a compiler to configure TCP Wrappers on your host. I have used gcc.
The Solaris 7 OS doesn't have IPV6 support. IPV6 support was first introduced in the Solaris 8 OS. Steps for the different versions of the Solaris OS are given below.
Where to Download TCP Wrappers
You can find TCP Wrappers at the site hosting Wietse's tools and papers:
Then look for lines to enable IPV6 support in the Solaris 8 OS and above. (Failure to do this will result in 0.0.0.0 as the log address.)
# If your system has IPv6 and supports getipnode* and inet_pton/inet_ntop
# comment out the following (Solaris 8 or above)
#IPV6 = -DHAVE_IPV6
Remove the comment (#) sign from the last of these lines, so that it reads:
IPV6 = -DHAVE_IPV6
You might also want to edit the LOG LEVEL and LOG FACILITY values. They are set to a default of LOG_MAIL and LOG_INFO. For possible values, look at /usr/include/sys/syslog.h file and change as per your requirements.
Finally, compile the source code after determining your OS version and revision using uname -sr:
Similarly, make changes to all the services you want. Save your changes and exit out of vi.
Send a HUP to inetd to re-read the configuration file.
# pkill -HUP inetd
If you are using the Solaris 7 OS, the protocol field in inetd.conf may be just tcp and not tcp6.
Testing What You Have Done
Send a HUP to syslog if you have changed the facility and level when compiling the TCP wrappers.
Add the corresponding lines to syslog.conf:
# pkill -HUP syslogd
# tail -f /var/log/syslog
Telnet into the machine running the Solaris OS from another host, and you should see something like:
Jul 14 10:12:02 hydra in.telnetd[294]: connect from gizmo
Creating Your Access Control Files
Create your access control files /etc/hosts.deny and /etc/hosts.allow to deny or allow access to the host.
Syntax for both the files is:
service-list: host-list
service-list is a comma-separated list of services as listed in the last field of entries in /etc/inetd.conf, and host-list is a comma-separated list of host names, domain names, or IP addresses. A host name or IP address matches an individual host, and a domain name starting with a dot matches all hosts within that domain.
Example:
in.ftpd,in.telnetd: 192.168.1.10, .test.sun.com
ALL is a keyword that would match any host on the net.
To get the best out of TCP Wrappers, create /etc/hosts.deny with ALL:ALL so that everyone else is denied. Add the services to be accessible and the corresponding hosts, domains, or networks that can access these services.
Configuring OpenSSH With TCP Wrapper Support
You will need libwrap.a and tcpd.h if you want to compile OpenSSH with TCP Wrapper support. Copy these files to a different location if you want to clean up /var/tmp/tcpd.
Addendum/Comments
Commentor: Casper Dik Added: September 7, 2004 Comment:
It is rather pointless to install TCP wrappers for Solaris 9 and later as the version included in the OS is exactly the same as the one available on porcupine. That version has also been reved twice because of bugs we ran into. Solaris 9 SSH already has libwrap support compiled on. In S10 and later we also provide rpcbind linked with libwrap.
The information and links on this page have been provided by a BigAdmin
user. The submitter is solely responsible for such information and
links. Sun is not responsible for the availability of external sites or
resources, and does not endorse and is not responsible or liable for any
content, advertising, products, or other materials on or available from
such sites or resources. Sun will not be responsible or liable, directly
or indirectly, for any actual or alleged damage or loss caused by or in
connection with use of or reliance on the information posted here, or
goods or services available on or through any external site or
resource.