netrc(4tcp)


netrc -- file for ftp remote login data

Description

The .netrc file contains data for logging in to a remote host over the network for file transfers by ftp(1tcp). This file resides in the user's home directory on the machine initiating the file transfer. Its permissions should be set to disallow read access by group and others (see chmod(1)).

The following tokens are recognized. They may be separated by space, tab or newline characters:


account string
Supply an additional account password. If this token is present, the auto-login process will supply the specified string if the remote server requires an additional account password, or the auto-login process will initiate an ACCT command if it does not.

default
This is the 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 as:
   default login anonymous password user@site
which gives the user automatic anonymous ftp login to machines not specified in .netrc. This can be overridden by using the -n option to ftp to disable auto-login.

login name
Identify a user on the remote machine. If this token is present, the auto-login process will initiate a login using the specified name.

macdef name
Define a macro. This functions in the same way as the ftp macdef command. A macro is defined with the specified name. Its contents begin with the next .netrc line and continue until a null line (consecutive newline characters) is encountered. If a macro named init is defined, it is automatically executed as the last step in the auto-login process.

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 or as an open command argument. Once a match is made, the subsequent .netrc tokens are processed, stopping when EOF is reached or another machine token is encountered.

password string
Supply a password. If this token is present, the auto-login process will supply 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, ftp will abort the auto-login process if the .netrc is readable by anyone besides the user.

Files


~/.netrc

References

chmod(1), ftp(1tcp), ftpd(1Mtcp)

Examples

A .netrc file containing the following line:
   machine ray login demo password clydenw
allows an autologin to the machine ray using the login name demo with password ``clydenw''.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004