netrc.4 (2010 09)

n
netrc(4) netrc(4)
NAME
netrc: .netrc - login information for ftp, rexec, and rexec()
DESCRIPTION
The
.netrc file contains login and initialization information used by the
ftp autologin process, by the
rexec() library routine, and by the rexec
command (see ftp (1), rexec (3N), and remsh(1)), respectively.
This file is optional. It exists, if at all, in the user’s home directory.
If the
.netrc file contains password or account information for use other than for anonymous
ftp, its
owner must match the effective user ID of the current process. Its read, write, and execute mode bits for
group and other must all be zero, and it must be readable by its owner. Otherwise, the file is ignored.
The file can contain the following tokens, separated by whitespace (spaces, tabs, or newlines) or commas
(
,). To include a comma as part of a token, enclose that token in quotation marks (
").
machine name Identify a remote machine name. The autologin process searches the
.netrc file
for a
machine token that matches the remote machine specified on the
ftp com-
mand line, as an
ftp open command argument, or as the
*ahost parameter of
rexec(). Once a match is made, the subsequent
.netrc tokens are processed,
stopping when the end-of-file is reached or another
machine token or a default
token is encountered.
If the remote machine name has an alias host name, and both the official host name
and the alias are present in the
.netrc file, the ftp client gives precedence to the
official host name over the alias when searching the .netrc file. If an alias is
given as an entry to the ftp open command, and in the search from the top of the
.netrc file to the bottom, the ftp client finds the alias host name before it finds
the official host name, it will use the alias’s entry. However, if it finds the official
host name first, it will use the official entry even though the alias host name also
exists in the .netrc file. So the high precedence given to the official host name
requires placing the official host name entry last in the .netrc file for
ftp when
aliases exist.
default Same as machine name except that default matches any name. There can be
only one default token, and it must be after all machine tokens. This is nor-
mally used for ftp as follows:
default login anonymous password user@site
This provides automatic anonymous ftp login to machines not specified in
.netrc. This can be overridden in ftp by using the -n flag to disable autologin.
login name Identify a user on the remote machine. If this token is present, the ftp or
rexec() autologin process initiates a login using the specified name. If this token
matches the user name used by the rexec -l command option, or, by default, the
local user name, rexec uses the password token, if present.
password string Supply a password. If this token is present, the autologin process supplies the
specified string, if the remote server requires a password as part of the login pro-
cess. Note that if this token is present in the .netrc file for any user other than
anonymous, ftp aborts the autologin process if the .netrc is readable by any-
one other than the owner. Also note that the passwords in .netrc are not
encrypted.
account string Supply an additional account password for ftp login. If this token is present, the
autologin process supplies the specified string if the remote server requires an addi-
tional account password, or the autologin process initiates an acct command if it
does not.
macdef name Define an ftp macro. This token is just like the ftp macdef command. A macro
is defined with the specified name; its contents begin with the next .netrc line
and continue until an empty line (consecutive newline characters) is encountered.
If a macro named init is defined, it is automatically executed as the last step in
the ftp autologin process.
EXAMPLES
The following is a valid entry for the host
hpxdzg whose guest account has the password sesame:
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)