| 1 |
.\" Copyright (c) 1985, 1989, 1990, 1993 |
| 2 |
.\" The Regents of the University of California. All rights reserved. |
| 3 |
.\" |
| 4 |
.\" Redistribution and use in source and binary forms, with or without |
| 5 |
.\" modification, are permitted provided that the following conditions |
| 6 |
.\" are met: |
| 7 |
.\" 1. Redistributions of source code must retain the above copyright |
| 8 |
.\" notice, this list of conditions and the following disclaimer. |
| 9 |
.\" 2. Redistributions in binary form must reproduce the above copyright |
| 10 |
.\" notice, this list of conditions and the following disclaimer in the |
| 11 |
.\" documentation and/or other materials provided with the distribution. |
| 12 |
.\" 4. Neither the name of the University nor the names of its contributors |
| 13 |
.\" may be used to endorse or promote products derived from this software |
| 14 |
.\" without specific prior written permission. |
| 15 |
.\" |
| 16 |
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND |
| 17 |
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 |
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 19 |
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 20 |
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 21 |
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 22 |
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 23 |
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 24 |
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 25 |
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 26 |
.\" SUCH DAMAGE. |
| 27 |
.\" |
| 28 |
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 |
| 29 |
.\" |
| 30 |
.Dd February 9, 2019 |
| 31 |
.Dt netrc 5 URM |
| 32 |
.Os "GNU Network Utilities" |
| 33 |
.Sh NAME |
| 34 |
.Nm netrc |
| 35 |
.Nd |
| 36 |
user configuration for ftp |
| 37 |
.Sh SYNOPSIS |
| 38 |
.Nm ~/.netrc |
| 39 |
.Sh DESCRIPTION |
| 40 |
The |
| 41 |
.Pa .netrc |
| 42 |
file contains login and initialization information |
| 43 |
used by the auto-login process. |
| 44 |
It resides in the user's home directory. |
| 45 |
The following tokens are recognized; they may be separated by spaces, |
| 46 |
tabs, or new-lines: |
| 47 |
.Bl -tag -width password |
| 48 |
.It Ic machine Ar name |
| 49 |
Identify a remote machine |
| 50 |
.Ar name . |
| 51 |
The auto-login process searches the |
| 52 |
.Pa .netrc |
| 53 |
file for a |
| 54 |
.Ic machine |
| 55 |
token that matches the remote machine specified on the |
| 56 |
.Nm ftp |
| 57 |
command line or as an |
| 58 |
.Ic open |
| 59 |
command argument. |
| 60 |
Once a match is made, the subsequent |
| 61 |
.Pa .netrc |
| 62 |
tokens are processed, |
| 63 |
stopping when the end of file is reached or another |
| 64 |
.Ic machine |
| 65 |
or a |
| 66 |
.Ic default |
| 67 |
token is encountered. |
| 68 |
.It Ic default |
| 69 |
This is the same as |
| 70 |
.Ic machine |
| 71 |
.Ar name |
| 72 |
except that |
| 73 |
.Ic default |
| 74 |
matches any name. |
| 75 |
There can be only one |
| 76 |
.Ic default |
| 77 |
token, and it must be after all |
| 78 |
.Ic machine |
| 79 |
tokens. |
| 80 |
This is normally used as: |
| 81 |
.Pp |
| 82 |
.Dl default login anonymous password user@site |
| 83 |
.Pp |
| 84 |
thereby giving the user |
| 85 |
.Ar automatic |
| 86 |
anonymous ftp login to |
| 87 |
machines not specified in |
| 88 |
.Pa .netrc . |
| 89 |
This can be overridden |
| 90 |
by using the |
| 91 |
.Fl n |
| 92 |
flag to disable auto-login. |
| 93 |
.It Ic login Ar name |
| 94 |
Identify a user on the remote machine. |
| 95 |
If this token is present, the auto-login process will initiate |
| 96 |
a login using the specified |
| 97 |
.Ar name . |
| 98 |
.It Ic password Ar string |
| 99 |
Supply a password. |
| 100 |
If this token is present, the auto-login process will supply the |
| 101 |
specified string if the remote server requires a password as part |
| 102 |
of the login process. |
| 103 |
Note that if this token is present in the |
| 104 |
.Pa .netrc |
| 105 |
file for any user other |
| 106 |
than |
| 107 |
.Ar anonymous , |
| 108 |
.Nm ftp |
| 109 |
will abort the auto-login process if the |
| 110 |
.Pa .netrc |
| 111 |
is readable by |
| 112 |
anyone besides the user. |
| 113 |
.It Ic account Ar string |
| 114 |
Supply an additional account password. |
| 115 |
If this token is present, the auto-login process will supply the |
| 116 |
specified string if the remote server requires an additional |
| 117 |
account password, or the auto-login process will initiate an |
| 118 |
.Dv ACCT |
| 119 |
command if it does not. |
| 120 |
.It Ic macdef Ar name |
| 121 |
Define a macro. |
| 122 |
This token functions like the |
| 123 |
.Nm ftp |
| 124 |
.Ic macdef |
| 125 |
command functions. |
| 126 |
A macro is defined with the specified name; its contents begin with the |
| 127 |
next |
| 128 |
.Pa .netrc |
| 129 |
line and continue until a null line (consecutive new-line |
| 130 |
characters) is encountered. |
| 131 |
If a macro named |
| 132 |
.Ic init |
| 133 |
is defined, it is automatically executed as the last step in the |
| 134 |
auto-login process. |
| 135 |
.El |
| 136 |
.Sh SEE ALSO |
| 137 |
.Xr ftp 1 , |
| 138 |
.Xr ftpd 8 |