{"id":35663,"date":"2010-06-18T11:05:09","date_gmt":"2010-06-18T15:05:09","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=35663"},"modified":"2013-05-02T16:28:45","modified_gmt":"2013-05-02T20:28:45","slug":"tcpwrappers_macosx","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/about\/security-resources\/host-based\/tcpwrappers_macosx\/","title":{"rendered":"Configuring TCP Wrappers on MAC OS X"},"content":{"rendered":"<h2>What are TCP Wrappers<\/h2>\n<p>TCP  wrappers            provide a means to control which IP addresses  are allowed or  not allowed            to connect to services that you  have enabled on your host such  as Remote            Login (ssh), Apple  Remote Desktop (vnc), and Personal Web  Sharing (www).<\/p>\n<p>As with other Operating Systsems, MAC OS X uses the tcp daemon (tcpd) to implement this functionality\u00a0 (<em>see  &#8220;man tcpd&#8221;<\/em>).<\/p>\n<h2>How to Configure TCP Wrappers<\/h2>\n<p>In order to make use of tcp wrappers, you need to create two  files            in <strong>\/etc<\/strong> called <strong>hosts.deny<\/strong> and <strong>hosts.allow<\/strong> (see samples below). Both files must be present in order for  this to            work. If you do not create these files, the entire Internet  has access            to the services you have enabled greatly lowering  the security            of your host.<\/p>\n<p>In Terminal, after you become super user (likely by sudo -s), you may use your  favorite            text editor such as pico or vi to create the two files.<\/p>\n<p><strong>Sample \/etc\/hosts.deny<\/strong><\/p>\n<p style=\"padding-left: 30px;\">#<br \/>\n# hosts.deny This file describes the names of the hosts which  are<br \/>\n# denied the use of local INET services, as decided<br \/>\n# by the &#8216;\/usr\/sbin\/tcpd&#8217; server.<br \/>\n#<br \/>\nALL: ALL:deny<\/p>\n<p><strong>Sample \/etc\/hosts.allow<\/strong><\/p>\n<p style=\"padding-left: 30px;\">#<br \/>\n# hosts.allow This file describes the names of the hosts which  are<br \/>\n# allowed to use the local INET services, as decided<br \/>\n# by the &#8216;\/usr\/sbin\/tcpd&#8217; server.<br \/>\n#<br \/>\nALL:128.197.79.<\/p>\n<h3>Explanation of Sample Files<\/h3>\n<p>The &#8220;ALL: ALL:deny&#8221; statement in the \/etc\/hosts.deny files prevents all external hosts from accessing the host you  created the files on.<\/p>\n<p>Then we allow only those hosts we trust or need, to  accomplish the task at hand. In the example above, only hosts on the  128.197.79 subnet are allowed to access the host. NOTE: There is a . after the  79; you need that in order for this to work. You can allow connections  from all of the Boston University subnets by removing the entire  .79 line and adding the following:<\/p>\n<p style=\"padding-left: 30px;\">ALL: 128.197.<br \/>\nALL: 168.122.<br \/>\nALL: 155.144.<\/p>\n<p>Keep in mind that this is a very broad range covering most of the Boston University campuses.\u00a0 To refine this further, see our documentation on the <a target=\"_blank\" href=\"\/tech\/services\/security\/firewalls\/campus\/ipspace\/\">Campus IP Address Space<\/a>.<\/p>\n<p>You can also limit access to only a few other hosts by adding an  entry for            only those IPs in the \/etc\/hosts.allow file as seen in the  example below.<\/p>\n<p style=\"padding-left: 30px;\">ALL: 128.197.2.25<br \/>\nALL: 128.197.5.89<\/p>\n<p>For more information, please consult\u00a0<a href=\"www.hmug.org\/UnixHowTos\/index.php?tcpwrappers\">www.hmug.org\/UnixHowTos\/index.php?tcpwrappers<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What are TCP Wrappers TCP wrappers provide a means to control which IP addresses are allowed or not allowed to connect to services that you have enabled on your host such as Remote Login (ssh), Apple Remote Desktop (vnc), and Personal Web Sharing (www). As with other Operating Systsems, MAC OS X uses the tcp&#8230;<\/p>\n","protected":false},"author":2620,"featured_media":0,"parent":7971,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/35663"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/2620"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=35663"}],"version-history":[{"count":4,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/35663\/revisions"}],"predecessor-version":[{"id":35666,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/35663\/revisions\/35666"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/7971"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=35663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}