Specifies remote systems that can execute commands on the local system.
The /etc/hosts.equiv file, along with any local $HOME/.rhosts files, defines the hosts (computers on a network) and user accounts that can invoke remote commands on a local host without supplying a password. A user or host that is not required to supply a password is considered trusted.
When a local host receives a remote command request, the appropriate local daemon first checks the /etc/hosts.equiv file to determine if the request originates with a trusted user or host. For example, if the local host receives a remote login request, the rlogind daemon checks for the existence of a hosts.equiv file on the local host. If the file exists but does not define the host or user, the system checks the appropriate $HOME/.rhosts file. This file is similar to the /etc/hosts.equiv file, except that it is maintained for individual users.
Both files, hosts.equiv and .rhosts must have permissions denying write access to group and other. If either group or other have write access to a file, that file will be ignored.
Do not give write permission to the /etc/hosts.equiv file to group and others. Permissions of the /etc/hosts.equiv file should be set to 600 (read and write by owner only).
If a remote command request is made by the root user, the /etc/hosts.equiv file is ignored and only the /.rhosts file is read.
Granting and Denying Trust
You grant trust from a local host to a remote host or remote user. The local machine's /etc/hosts.equiv file contains entries for each trusted host or user. The format of an entry is:
HostName [UserName]The HostName field specifies the name of the host to trust. The UserName field specifies the name of the user on that remote host to trust. The UserName field is optional.
You can use the + (plus sign) as a wildcard in either the HostName or UserName field to grant trust to all users from a particular host or from all hosts that a specific user has an account on. To grant trust to every user on every machine on the network, place a plus sign (+) at the beginning of the file.
You deny a host or user trust by omitting them from the /etc/hosts.equiv file altogether. By omitting the host or user, you imply they are not trusted. This is the most secure way to deny trust. Otherwise, you can explicitly deny trust to a specific host or user by using the - (minus sign). The format to explicitly deny a host is:
-HostNameThe format to explicitly deny a specific user from a host is:
HostName [-UserName]Using NIS with the /etc/hosts.equiv file
If your network uses the Network Information Services (NIS), you can use netgroups in place of either the HostName or UserName field. The system resolves the netgroup depending on which field the netgroup replaces. For example, if you place a netgroup in the HostName field, the system resolves the hosts component of the netgroup. If the netgroup appears in the UserName field, the user component is resolved. Use the following format to grant trust to a netgroup:
+@NetGroupTo deny trust, use the following:
-@NetGroupRefer to the NIS netgroup file for more information on netgroups.
Ordering Entries in the /etc/hosts.equiv File
The order of entries in the /etc/hosts.equiv file is important. When verifying trust, the system parses the /etc/hosts.equiv file from top to bottom. When it encounters an entry that matches the host or user attempting a remote command, the system stops parsing the file and grants or denies trust based on the entry. Any additional entries that appear later in the file are ignored.
emerald
amethystemerald
amethyst gregoryemerald
amethyst gregory
+ peteremerald
amethyst gregory
+ peter
+@centuryemerald
amethyst gregory 
+ peter
+@century
citrine +@engineersemerald
amethyst gregory 
+ peter
+@century
citrine +@engineers
+@servers +@sysadminsemerald
amethyst gregory 
+ peter
+@century
citrine -lydia
citrine +@engineers
+@servers +@sysadminsemerald
amethyst gregory 
+ peter
+@century
citrine +@engineers
citrine -lydia
+@servers +@sysadmins| Item | Description | 
|---|---|
| $HOME/.rhosts | Specifies remote users who can use a local-user account. |