Header Ads Widget

[MAN] hosts

Content-type: text/html; charset=UTF-8 Man page of HOSTS.EQUIV

HOSTS.EQUIV

Section: Linux Programmer's Manual (5)
Updated: 2015-07-23
Index Return to Main Contents
 

NAME

hosts.equiv - list of hosts and users that are granted "trusted" r command access to your system  

DESCRIPTION

The file /etc/hosts.equiv allows or denies hosts and users to use the r-commands (e.g., rlogin, rsh, or rcp) without supplying a password.

The file uses the following format:

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

The hostname is the name of a host which is logically equivalent to the local host. Users logged into that host are allowed to access like-named user accounts on the local host without supplying a password. The hostname may be (optionally) preceded by a plus (+) sign. If the plus sign is used alone, it allows any host to access your system. You can explicitly deny access to a host by preceding the hostname by a minus (-) sign. Users from that host must always supply additional credentials, including possibly a password. For security reasons you should always use the FQDN of the hostname and not the short hostname.

The username entry grants a specific user access to all user accounts (except root) without supplying a password. That means the user is NOT restricted to like-named accounts. The username may be (optionally) preceded by a plus (+) sign. You can also explicitly deny access to a specific user by preceding the username with a minus (-) sign. This says that the user is not trusted no matter what other entries for that host exist.

Netgroups can be specified by preceding the netgroup by an @ sign.

Be extremely careful when using the plus (+) sign. A simple typographical error could result in a standalone plus sign. A standalone plus sign is a wildcard character that means "any host"!  

FILES

/etc/hosts.equiv  

NOTES

Some systems will honor the contents of this file only when it has owner root and no write permission for anybody else. Some exceptionally paranoid systems even require that there be no other hard links to the file.

Modern systems use the Pluggable Authentication Modules library (PAM). With PAM a standalone plus sign is considered a wildcard character which means "any host" only when the word promiscuous is added to the auth component line in your PAM file for the particular service (e.g., rlogin).  

EXAMPLE

Below are some example /etc/host.equiv or ~/.rhosts files.

Allow any user to log in from any host:


    +

Allow any user from host with a matching local account to log in:


    host

Note: the use of +host is never a valid syntax, including attempting to specify that any user from the host is allowed.

Allow any user from host to log in:


    host +

Note: this is distinct from the previous example since it does not require a matching local account.

Allow user from host to log in as any non-root user:


    host user

Allow all users with matching local accounts from host to log in except for baduser:


    host -baduser
    host

Deny all users from host:


    -host

Note: the use of -host -user is never a valid syntax, including attempting to specify that a particular user from the host is not trusted.

Allow all users with matching local accounts on all hosts in a netgroup:


    +@netgroup

Disallow all users on all hosts in a netgroup:


    -@netgroup

Allow all users in a netgroup to log in from host as any non-root user:


    host +@netgroup

Allow all users with matching local accounts on all hosts in a netgroup except baduser:


    +@netgroup -baduser
    +@netgroup

Note: the deny statements must always precede the allow statements because the file is processed sequentially until the first matching rule is found.  

SEE ALSO

rhosts(5), rlogind(8), rshd(8)  

COLOPHON

This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.


 

Index

NAME
DESCRIPTION
FILES
NOTES
EXAMPLE
SEE ALSO
COLOPHON

This document was created by man2html, using the manual pages.
Time: 04:45:54 GMT, September 16, 2022 Content-type: text/html; charset=UTF-8 Man page of HOSTS

HOSTS

Section: Linux Programmer's Manual (5)
Updated: 2017-09-15
Index Return to Main Contents
 

NAME

hosts - static table lookup for hostnames  

SYNOPSIS

/etc/hosts  

DESCRIPTION

This manual page describes the format of the /etc/hosts file. This file is a simple text file that associates IP addresses with hostnames, one line per IP address. For each host a single line should be present with the following information:

IP_address canonical_hostname [aliases...]

Fields of the entry are separated by any number of blanks and/or tab characters. Text from a "#" character until the end of the line is a comment, and is ignored. Host names may contain only alphanumeric characters, minus signs ("-"), and periods ("."). They must begin with an alphabetic character and end with an alphanumeric character. Optional aliases provide for name changes, alternate spellings, shorter hostnames, or generic hostnames (for example, localhost).

The Berkeley Internet Name Domain (BIND) Server implements the Internet name server for UNIX systems. It augments or replaces the /etc/hosts file or hostname lookup, and frees a host from relying on /etc/hosts being up to date and complete.

In modern systems, even though the host table has been superseded by DNS, it is still widely used for:

bootstrapping
Most systems have a small host table containing the name and address information for important hosts on the local network. This is useful when DNS is not running, for example during system bootup.
NIS
Sites that use NIS use the host table as input to the NIS host database. Even though NIS can be used with DNS, most NIS sites still use the host table with an entry for all local hosts as a backup.
isolated nodes
Very small sites that are isolated from the network use the host table instead of DNS. If the local information rarely changes, and the network is not connected to the Internet, DNS offers little advantage.
 

FILES

/etc/hosts  

NOTES

Modifications to this file normally take effect immediately, except in cases where the file is cached by applications.  

Historical notes

RFC 952 gave the original format for the host table, though it has since changed.

Before the advent of DNS, the host table was the only way of resolving hostnames on the fledgling Internet. Indeed, this file could be created from the official host data base maintained at the Network Information Control Center (NIC), though local changes were often required to bring it up to date regarding unofficial aliases and/or unknown hosts. The NIC no longer maintains the hosts.txt files, though looking around at the time of writing (circa 2000), there are historical hosts.txt files on the WWW. I just found three, from 92, 94, and 95.  

EXAMPLE

# The following lines are desirable for IPv4 capable hosts 127.0.0.1 localhost

# 127.0.1.1 is often used for the FQDN of the machine 127.0.1.1 thishost.mydomain.org thishost 192.168.1.10 foo.mydomain.org foo 192.168.1.13 bar.mydomain.org bar 146.82.138.7 master.debian.org master 209.237.226.90 www.opensource.org

# The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters  

SEE ALSO

hostname(1), resolver(3), host.conf(5), resolv.conf(5), resolver(5), hostname(7), named(8)

Internet RFC 952  

COLOPHON

This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.


 

Index

NAME
SYNOPSIS
DESCRIPTION
FILES
NOTES
Historical notes
EXAMPLE
SEE ALSO
COLOPHON

This document was created by man2html, using the manual pages.
Time: 04:45:54 GMT, September 16, 2022

댓글 쓰기

0 댓글