1 '\" te
   2 .\"  Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
   3 .\" Copyright 1989 AT&T
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH NETRC 4 "Aug 25, 2006"
   8 .SH NAME
   9 netrc \- file for ftp remote login data
  10 .SH DESCRIPTION
  11 .sp
  12 .LP
  13 The \fB\&.netrc\fR file contains data for logging in to a remote host over the
  14 network for file transfers by \fBftp\fR(1). This file resides in the user's
  15 home directory on the machine initiating the file transfer. Its permissions
  16 should be set to disallow read access by group and others. See \fBchmod\fR(1).
  17 .sp
  18 .LP
  19 Tokens can be separated by \fBSPACE\fR, \fBTAB\fR, or \fBNEWLINE\fR characters.
  20 The following tokens are supported:
  21 .sp
  22 .ne 2
  23 .na
  24 \fB\fBaccount\fR \fIstring\fR\fR
  25 .ad
  26 .RS 19n
  27 Supply an additional account password. If this token is present, the auto-login
  28 process supplies the specified string if the remote server requires an
  29 additional account password. If the remote server does not require an
  30 additional account password, the auto-login process initiates an \fBACCT\fR
  31 command.
  32 .RE
  33 
  34 .sp
  35 .ne 2
  36 .na
  37 \fB\fBdefault\fR\fR
  38 .ad
  39 .RS 19n
  40 Same as \fBmachine\fR \fIname\fR, except that default matches any name. There
  41 can be only one \fBdefault\fR token, and it must be after all \fBmachine\fR
  42 tokens. The \fBdefault\fR token is normally used as follows:
  43 .sp
  44 .in +2
  45 .nf
  46 default login anonymous password \fIuser\fR@\fIsite\fR
  47 .fi
  48 .in -2
  49 .sp
  50 
  51 Such an entry gives the user automatic anonymous \fBftp\fR login to machines
  52 not specified in \fB\&.netrc\fR.
  53 .RE
  54 
  55 .sp
  56 .ne 2
  57 .na
  58 \fB\fBlogin\fR \fIname\fR\fR
  59 .ad
  60 .RS 19n
  61 Identify a user on the remote machine. If this token is present, the auto-login
  62 process initiates a login using the specified name.
  63 .RE
  64 
  65 .sp
  66 .ne 2
  67 .na
  68 \fB\fBmachine\fR \fIname\fR\fR
  69 .ad
  70 .RS 19n
  71 Identify a remote machine name. The auto-login process searches the
  72 \fB\&.netrc\fR file for a \fBmachine\fR token that matches the remote machine
  73 specified on the \fBftp\fR command line or as an \fBopen\fR command argument.
  74 Once a match is made, the subsequent \fB\&.netrc\fR tokens are processed,
  75 stopping when the \fBEOF\fR is reached or another \fBmachine\fR token is
  76 encountered.
  77 .RE
  78 
  79 .sp
  80 .ne 2
  81 .na
  82 \fB\fBmacdef\fR \fIname\fR\fR
  83 .ad
  84 .RS 19n
  85 Define a macro. This token functions the same as \fBftp\fR \fBmacdef\fR. A
  86 macro is defined with the specified name; its contents begin with the next
  87 \fB\&.netrc\fR line and continue until a null line (consecutive \fBNEWLINE\fR
  88 characters) is encountered. If a macro named \fBinit\fR is defined, it is
  89 automatically executed as the last step in the auto-login process.
  90 .RE
  91 
  92 .sp
  93 .ne 2
  94 .na
  95 \fB\fBpassword\fR \fIstring\fR\fR
  96 .ad
  97 .RS 19n
  98 Supply a password. If this token is present, the auto-login process supplies
  99 the specified string if the remote server requires a password as part of the
 100 login process. If this token is present in the \fB\&.netrc\fR file, \fBftp\fR
 101 aborts the auto-login process if the \fB\&.netrc\fR is readable by anyone
 102 besides the user.
 103 .RE
 104 
 105 .sp
 106 .ne 2
 107 .na
 108 \fB\fBskipsyst\fR\fR
 109 .ad
 110 .RS 19n
 111 Skip the \fBSYST\fR command that is sent by default to all remote servers upon
 112 connection. The system command is what enables the automatic use of binary mode
 113 rather than the protocol default ascii mode.
 114 .sp
 115 As some older servers cannot handle the \fBftp\fR command, this directive is
 116 provided to allow inter-operability with these servers.
 117 .RE
 118 
 119 .SH EXAMPLES
 120 .LP
 121 \fBExample 1 \fRA Sample \fB\&.netrc\fR File
 122 .sp
 123 .LP
 124 A \fB\&.netrc\fR file containing the following line:
 125 
 126 .sp
 127 .in +2
 128 .nf
 129 machine ray login demo password mypassword
 130 .fi
 131 .in -2
 132 
 133 .sp
 134 .LP
 135 allows an autologin to the machine \fBray\fR using the login name \fBdemo\fR
 136 with password \fBmypassword\fR.
 137 
 138 .SH FILES
 139 .sp
 140 .ne 2
 141 .na
 142 \fB\fB~/.netrc\fR\fR
 143 .ad
 144 .RS 12n
 145 
 146 .RE
 147 
 148 .SH SEE ALSO
 149 .sp
 150 .LP
 151 \fBchmod\fR(1), \fBftp\fR(1), \fBin.ftpd\fR(1M)