ftp and ".netrc" file

ftp and ".netrc" file

Post by Jack R Smi » Mon, 15 Jul 1996 04:00:00



I'm trying set up a .netrc file in my account so that I will be
automatically logged into a machine I'm ftp-ing to.  The following
excerpt from the man pages on ftp hints that this has something to do
with the ".netrc" file.

"    -n    Do not attempt auto-login upon initial connection.  If
          auto-login  is not disabled, ftp checks the .netrc file
          in the user's home directory for an entry describing an
          account on the remote machine.  If no entry exists, ftp
          will prompt for the login name of the  account  on  the
          remote  machine  (the  default is the login name on the
          local machine), and, if necessary, prompts for a  pass-
          word and an account with which to login.
"

I do not have one of these files but would like to create one for myself.
The problem is that I don't know how to "describe an account on a remote
machine".  Anybody know how to do this and/or have any examples?

Thanks.

 
 
 

ftp and ".netrc" file

Post by Harrison Berger » Tue, 16 Jul 1996 04:00:00



 >I'm trying set up a .netrc file in my account so that I will be
 >automatically logged into a machine I'm ftp-ing to.  The following
 >excerpt from the man pages on ftp hints that this has something to do
 >with the ".netrc" file.
 >
 >"    -n    Do not attempt auto-login upon initial connection.  If
                .
                .
                .
 >I do not have one of these files but would like to create one for myself.
 >The problem is that I don't know how to "describe an account on a remote
 >machine".  Anybody know how to do this and/or have any examples?
 >

machine         po.dunk.edu
login           bubba
password        luser

        The file is not supposed to be readable by anyone
        but the user or the ftp session will fail.

--

    Steinberger:
State of the Instrument

 
 
 

ftp and ".netrc" file

Post by Timothy R Prod » Tue, 16 Jul 1996 04:00:00




[Looking for .netrc help]

Quote:>I do not have one of these files but would like to create one for myself.
>The problem is that I don't know how to "describe an account on a remote
>machine".  Anybody know how to do this and/or have any examples?

Well, for all the*details, try man netrc.  For a summary:

The file must be owned by you or root, and in your home directory.  It
must be permission 700 (octal).

A line in a .netrc looks like:

machine <machinename> login <login as> password <password>

For a typical example, try:


This will automate an anonymous connection for you.

Further, you can define a macro, or set of macros with macdef. "A macro
is defined with the specified name; and its contents begin with the
next .netrc line and contine until a null line is encountered.   [A
macro named init] is automatically executed as the last step in the
auto-login process."  [netrc(4)]

So, you could expand the previous example with:


prompt
binary


This will automate the login for X, and for the gnu software as
I learned the machine name.

You can also define auto ftp logins to other machines without
anonymous, but remember to change your password in your .netrc
file when you change your login password for that machine.

--
-------------------------------------------------------------------------------
"Would you put an octopus in your pants for the home team?  Think about it.
Take your time."               - C. W. Nevius S.F. Chronicle 5/25/95