1netrc(4)                         File Formats                         netrc(4)
2
3
4

NAME

6       netrc - file for ftp remote login data
7

DESCRIPTION

9       The  .netrc file contains data for logging in to a remote host over the
10       network for file transfers by ftp(1). This file resides in  the  user's
11       home directory on the machine initiating the file transfer. Its permis‐
12       sions should be set to disallow read access by group  and  others.  See
13       chmod(1).
14
15
16       Tokens  can be separated by SPACE, TAB, or NEWLINE characters. The fol‐
17       lowing tokens are supported:
18
19       account string     Supply an additional account password. If this token
20                          is  present,  the  auto-login  process  supplies the
21                          specified string if the remote  server  requires  an
22                          additional  account  password.  If the remote server
23                          does not require an additional account password, the
24                          auto-login process initiates an ACCT command.
25
26
27       default            Same  as  machine  name, except that default matches
28                          any name. There can be only one default  token,  and
29                          it  must  be  after  all machine tokens. The default
30                          token is normally used as follows:
31
32                            default login anonymous password user@site
33
34
35                          Such an entry gives the user automatic anonymous ftp
36                          login to machines not specified in .netrc.
37
38
39       login name         Identify a user on the remote machine. If this token
40                          is present, the auto-login process initiates a login
41                          using the specified name.
42
43
44       machine name       Identify  a  remote  machine  name.  The  auto-login
45                          process searches the .netrc file for a machine token
46                          that matches the remote machine specified on the ftp
47                          command line or as an open command argument. Once  a
48                          match is made, the subsequent .netrc tokens are pro‐
49                          cessed, stopping when the EOF is reached or  another
50                          machine token is encountered.
51
52
53       macdef name        Define a macro. This token functions the same as ftp
54                          macdef. A macro is defined with the specified  name;
55                          its  contents  begin  with  the next .netrc line and
56                          continue until  a  null  line  (consecutive  NEWLINE
57                          characters) is encountered. If a macro named init is
58                          defined, it is automatically executed  as  the  last
59                          step in the auto-login process.
60
61
62       password string    Supply  a  password.  If  this token is present, the
63                          auto-login process supplies the specified string  if
64                          the remote server requires a password as part of the
65                          login process. If  this  token  is  present  in  the
66                          .netrc  file,  ftp  aborts the auto-login process if
67                          the .netrc is readable by anyone besides the user.
68
69
70       skipsyst           Skip the SYST command that is sent by default to all
71                          remote  servers  upon connection. The system command
72                          is what enables the automatic  use  of  binary  mode
73                          rather than the protocol default ascii mode.
74
75                          As some older servers cannot handle the ftp command,
76                          this directive is provided to allow  inter-operabil‐
77                          ity with these servers.
78
79

EXAMPLES

81       Example 1 A Sample .netrc File
82
83
84       A .netrc file containing the following line:
85
86
87         machine ray login demo password mypassword
88
89
90
91       allows  an  autologin to the machine ray using the login name demo with
92       password mypassword.
93
94

FILES

96       ~/.netrc
97
98

SEE ALSO

100       chmod(1), ftp(1), in.ftpd(1M)
101
102
103
104SunOS 5.11                        25 Aug 2006                         netrc(4)
Impressum