---
name: "hosts.equiv"
section: "5"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/hosts.equiv"
---

# hosts.equiv(5)

trusted remote host and user name data base

## NAME

**hosts.equiv**, **rhosts** – trusted remote host and user name data base

## DESCRIPTION

The *hosts.equiv* and *.rhosts* files contain information regarding trusted hosts and users on the network. For each host a single line should be present with the following information:

simple

```
hostname [username]
```

or the more verbose

```
[+-][hostname|@netgroup] [[+-][username|@netgroup]]
```

A “@” indicates a host by netgroup or user by netgroup. A single “+” matches all hosts or users. A host name with a leading “-” will reject all matching hosts and all their users. A user name with leading “-” will reject all matching users from matching hosts.

Items are separated by any number of blanks and/or tab characters. A “#” indicates the beginning of a comment; characters up to the end of the line are not interpreted by routines which search the file.

Host names are specified in the conventional Internet DNS dotted-domains “.” (dot) notation using the [inet\_addr(3)](/inet_addr/3.md) routine from the Internet address manipulation library, [inet(3)](/inet/3.md). Host names may contain any printable character other than a field delimiter, newline, or comment character.

For security reasons, a user's **.rhosts** file will be ignored if it is not a regular file, or if it is not owned by the user, or if it is writable by anyone other than the user.

## FILES

- */etc/hosts.equiv*

  The **hosts.equiv** file resides in */etc*.

- *$HOME/.rhosts*

  **.rhosts** file resides in *$HOME*.

## EXAMPLES

```
bar.com foo
```

Trust user “foo” from host “bar.com”.

```
+@allclient
```

Trust all hosts from netgroup “allclient”.

```
+@allclient -@dau
```

Trust all hosts from netgroup “allclient” and their users except users from netgroup “dau”.

## SEE ALSO

[gethostbyname(3)](/gethostbyname/3.md), [inet(3)](/inet/3.md), [innetgr(3)](/innetgr/3.md), [ruserok(3)](/ruserok/3.md), [netgroup(5)](/netgroup/5.md), [ifconfig(8)](/ifconfig/8.md), [yp(8)](/yp/8.md)

## BUGS

This manual page is incomplete. For more information read the source in *src/lib/libc/net/rcmd.c* or the SunOS manual page.
