Skip Headers
Oracle® Fusion Middleware Man Page Reference for Oracle Directory Server Enterprise Edition
11g Release 1 (

Part Number E28967-01
Go to Documentation Home
Go to Table of Contents
Go to Index
Go to Feedback page
Contact Us

Go to previous page
Go to next page
PDF · Mobi · ePub


Format of host access control files for Directory Server Enterprise Edition




This manual page describes a simple access control language that is based on client (host name/address, user name), and server (process name, host name/address) patterns. Examples are given at the end. The impatient reader is encouraged to skip to the EXAMPLES section for a quick introduction.

In the following text, daemon is the the process name of a network daemon process, and client is the name and/or address of a host requesting service.

Note that the version of hosts_access supplied with Directory Server Enterprise Edition is different from the version delivered with Solaris. The Directory Server Enterprise Edition version of hosts_access has the following characteristics:


The access control software consults two files. The search stops at the first match:

A non-existing access control file is treated as if it were an empty file. Thus, access control can be turned off by providing no access control files.


Each access control file consists of zero or more lines of text. These lines are processed in order of appearance. The search terminates when a match is found.


The access control language implements the following patterns:


Wildcards `*' and `?' can be used to match hostnames or IP addresses. However, this method of matching cannot be used in conjunction with the following: net/mask matching, hostname matching beginning with `.' , IP address matching ending with `.' or a IPv6 rule (begins with '[').

The access control language supports explicit wildcards:


The universal wildcard, always matches.


Matches any host whose name does not contain a dot character.


Matches any user whose name is unknown, and matches any host whose name or address are unknown. This pattern should be used with care: host names may be unavailable due to temporary name server problems. A network address will be unavailable when the software cannot figure out what type of network it is talking to.

It is not recommended to use the UNKNOWN wildcard. Directory Server always fills in both host and address, so there is never a case when the host name is unknown. The user is unavailable because of no NIS netgroups support.


Matches any user whose name is known, and matches any host whose name and address are known. This pattern should be used with care: host names may be unavailable due to temporary name server problems. A network address will be unavailable when the software cannot figure out what type of network it is talking to.

In Directory Server the user is always marked as unknown and is unavailable because of the NIS Netgroup restriction.



Intended use is of the form: `list_1 EXCEPT list_2'; this construct matches anything that matches list_1 unless it matches list_2. The EXCEPT operator can be used in daemon_lists and in client_lists. The EXCEPT operator can be nested: if the control language would permit the use of parentheses, `a EXCEPT b EXCEPT c' would parse as `(a EXCEPT (b EXCEPT c))'.


Note that shell commands are not available on Microsoft Windows.


The following expansions are available within shell commands:

%a (%A)

The client (server) host address.


Client information: user@host, user@address, a host name, or just an address, depending on how much information is available.


The daemon process name (argv[0] value).

%h (%H)

The client (server) host name or address, if the host name is unavailable.

%n (%N)

The client (server) host name (or "unknown").


The daemon process id.


Server information: daemon@host, daemon@address, or just a daemon name, depending on how much information is available.


The client user name (or "unknown").


Expands to a single `%' character.

Characters in % expansions that may confuse the shell are replaced by underscores.


The language is flexible enough that different types of access control policy can be expressed with a minimum of fuss. Although the language uses two access control tables, the most common policies can be implemented with one of the tables being trivial or even empty.

When reading the examples below it is important to realize that the allow table is scanned before the deny table, that the search terminates when a match is found, and that access is granted when no match is found at all.

The examples use host and domain names. They can be improved by including address and/or network/netmask information, to reduce the impact of temporary name server lookup failures.


In this case, access is denied by default. Only explicitly authorized hosts are permitted access.

The default policy (no access) is implemented with a trivial deny file:

instance-path/config/hosts.deny:  ALL: ALL

This denies all service to all hosts, unless they are permitted access by entries in the allow file.

The explicitly authorized hosts are listed in the allow file. For example:


The first rule permits access from hosts in the local domain (no `.' in the host name). The second rule permits access from all hosts in the domain (notice the leading period), with the exception of


Here, access is granted by default; only explicitly specified hosts are refused service.

The default policy (access granted) makes the allow file redundant so that it can be omitted. The explicitly non-authorized hosts are listed in the deny file. For example:

ALL:, .some.domain
ALL EXCEPT 1389:, .other.domain 

The first rule denies some hosts and domains all services; the second rule still permits connections to directory port 1389 from other hosts and domains.


The next example permits requests to Directory Server port 1389 from hosts in the local domain (notice the leading dot). Requests from any other hosts are denied. Instead of the requested file, a finger probe is sent to the offending host. The result is mailed to the superuser.

1389: LOCAL, .my.domain 

ALL: (/usr/sfw/sbin/safe_finger -l @%h | \
      /usr/ucb/mail -s %d-%h root) &

The above example assumes that the safe_finger command is installed in /usr/sfw/sbin. For Solaris, the safe_finger command is in the SUNWtcpd package. The default location for the safe_finger command in the SUNWtcpd package is "/usr/sfw/sbin". For other operating systems the safe_finger command should be installed in a suitable place. The safe_finger command limits possible damage from data sent by the remote finger server, and gives better protection than the standard finger command. Shell commands for Windows is not supported, so Windows users should not use this rule.

The expansion of the %h (client host) and %d (service name) sequences is described in the section on shell commands.

Warning: do not booby-trap your finger daemon, unless you are prepared for infinite finger loops.

On network firewall systems this trick can be carried even further. The typical network firewall only provides a limited set of services to the outer world. All other services can be "bugged" just like the above tftp example. The result is an excellent early-warning system.


An error is reported when a syntax error is found in a host access control rule; when the length of an access control rule exceeds the capacity of an internal buffer (2048); when an access control rule is not terminated by a newline character; when the result of %letter expansion would overflow an internal buffer; when a system call fails that should not. All problems are written to the Directory Server instance access log.


instance-path/config/hosts.allow, (daemon,client) pairs are granted access. instance-path/config/hosts.deny, (daemon,client) pairs are denied access.

See Also

tcpd(1M) tcp/ip daemon wrapper program. tcpdchk(1M), tcpdmatch(1M), test programs.


If a name server lookup times out, the host name will not be available to the access control software, even though the host is registered.


Wietse Venema (

Department of Mathematics and Computing Science

Eindhoven University of Technology

Den Dolech 2, P.O. Box 513,

5600 MB Eindhoven, The Netherlands


See attributes(5) for descriptions of the following attributes:




Stability Level