netrc(5)netrc(5)Namenetrc - file used by ftp auto-login procedure (.netrc)
Description
The file contains frequently needed options for transfers. The file
resides in the owner's home directory on the machine from which the
owner initiates the file transfer. If the file includes passwords, set
permissions on the file with so that only the owner has read permis‐
sion.
The file uses the following format:
· Each line of the file defines options for a specific machine.
· A line in the file can be either a machine line or a default line.
· The default line must be the first line in the file if it is
present.
· Fields in a default line appear in this order: default, default
machine name.
· Fields in a machine line appear in this order: machine, machine
name, options.
· Fields on each line are separated by spaces or tabs.
The following are valid options for a machine line:
───────────────────────────────────────────────────────────────────
Option Parameter Default Description
───────────────────────────────────────────────────────────────────
machine machine name none Identifies a remote
machine name
login name local name Identifies user on the
remote machine
password password none Password for remote
login name
account password none Additional account password
macdef macro name none Defines a macro like the
ftp macdef command
───────────────────────────────────────────────────────────────────
Example
This is an example of a file:
machine cactus login smith
machine nic.ddn.mil login anonymous password anonymous
machine palm.stateu.edu login smith password ualonerwelcome
macdef byenow
quit
macdef ls
dir
The first line allows to log Smith into the machine after prompting for
and receiving Smith's password, as shown in this example:
$ ftp cactus
Connected to cactus.tech.edu
FTP server ready.
Password required for SMITH.
User logged in
ftp>
The second line of the file allows the user to perform an anonymous
transfer after typing this command:
$ ftp nic.ddn.mil
See for a description of anonymous FTP transfers.
The third line allows Smith to log into the machine Smith will not be
prompted for a password because this machine line includes password
information. Because the file includes password information, the file
must not have read permission set for world and group.
The lines are macro definitions, which operate much like shell aliases.
A blank line must follow each macro definition to signal the end of the
macro. The first macro definition defines as an alias for the command.
See Alsoftp(1c)netrc(5)