Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ftp(1)

remsh(1)

rexec(3N)

netrc(4)

NAME

netrc − login information for ftp(1) and rexec(3N)

DESCRIPTION

The .netrc file contains login and initialization information used by the ftp auto-login process, by the rexec() library routine, and by the rexec command (see ftp(1), rexec(3N), and remsh(1)), respecively. 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 spaces, tabs, or new-lines. 

machine name Identify a remote machine name.  The auto-login process searches the .netrc file for a machine token that matches the remote machine specified on the ftp command line, as an ftp open command argument, or as the *ahost parameter to 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. 

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 normally 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 auto-login. 

login name Identify a user on the remote machine.  If this token is present, the ftp or rexec() auto-login 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 auto-login process supplies the specified string if the remote server requires a password as part of the login process.  Note that if this token is present in the .netrc file for any user other than anonymous, ftp aborts the auto-login process if the .netrc is readable by anyone 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 auto-login process supplies the specified string if the remote server requires an additional account password, or the auto-login 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 new-line characters) is encountered.  If a macro named init is defined, it is automatically executed as the last step in the ftp auto-login process. 

EXAMPLES

The following is a valid entry for the host hpxdzg whose guest account has the password sesame:

machine  hpxdzg  login  guest  password  sesame

WARNINGS

It is a security risk to have unencrypted passwords in a file. 

AUTHOR

netrc was developed by the University of California, Berkeley. 

FILES

$HOME/.netrc

SEE ALSO

ftp(1), remsh(1), rexec(3N). 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026