Wednesday, March 28, 2007

Automate FTP Connection to Remote Host

The $HOME/.netrc file allows a local user to FTP to a remote destination in an automated manner. The presence of a .netrc file is usually due to a particular activity that requires frequent FTP transfers to a (presumably) trusted host. To setup the remote connection, here’s an example of its syntax.

#vi $HOME/.netrc
machine myfake_IP login myfake_login password myfake_password
:wq! (saves and quits vi)

The machine can be an IP or URL.

Note: Your IT or security department may prohibit or restrict the use of a .netrc file.

No comments: