Cage <(E-Mail Removed)> wrote
> How should the settings in
> my user's .netrc file look (man ftp doesn't tell me enough).
Have you tried man netrc ?
It should contain something like:
THE .netrc FILE
The .netrc file contains login and initialization information
used by the
auto-login process. It resides in the user's home directory.
The fol-
lowing tokens are recognized; they may be separated by spaces,
tabs, or
new-lines:
machine name
Identify a remote machine name. The auto-login process
searches
the .netrc file for a machine token that matches the
remote ma-
chine specified on the ftp command line or as an open
command
argument. Once a match is made, the subsequent .netrc
tokens
are processed, stopping when the end of file is reached
or an-
other machine or a default token is encountered.
default This is the same as machine name except that default
matches
any name. There can be only one default token, and it
must be
after all machine tokens. This is normally used as:
default login anonymous password user@site
thereby giving the user automatic anonymous ftp login
to ma-
chines not specified in .netrc. This can be overridden
by using
the -n flag to disable auto-login.
login name
Identify a user on the remote machine. If this token
is pre-
sent, the auto-login process will initiate a login
using the
specified name.
password string
Supply a password. If this token is present, the
auto-login
process will supply the specified string if the remote
server
requires a password as part of the login process. Note
that if
this token is present in the .netrc file for any user
other
than anonymous, ftp will abort the auto-login process
if the
.netrc is readable by anyone besides the user.
account string
Supply an additional account password. If this token
is pre-
sent, the auto-login process will supply the specified
string
if the remote server requires an additional account
password,
or the auto-login process will initiate an ACCT command
if it
does not.
macdef name
Define a macro. This token functions like the ftp
macdef com-
mand functions. A macro is defined with the specified
name;
its contents begin with the next .netrc line and
continue until
a null line (consecutive new-line characters) is
encountered.
If a macro named init is defined, it is automatically
executed
as the last step in the auto-login process.
----------------------------------------------------------------------
I use this sort of thing all the time.
~/.netrc contains
machine <remote_host_name> username <the_name> password
<the_password>
default username anonymous password
(E-Mail Removed)
then you can just run a script on a cron job , or something, that
contains
ftp <remote_host_name>
cd /pub/incoming
binary
put file.dat default.dat
quit
OK, the username and password are stored in the clear, but your home
directory and the ~/.netrc should be set to be inaccessible by anyone
else. And it is a special username/password, surely? not the same
one you use for everything?