Tuesday, October 8, 2013

Non interactive ftp for Linux users

FTP. Yes, people are still using it.

  1.  non interactive ftp login:
    $ ~/.netrc
    machine server_name/ip
    login username
    password password


    $ chmod 600 ~/.netrc
    Now you can simply ftp to said machine and it will auto-login.

  2.  Copying a file to the ftp server:
    • echo put FILE.ext | ftp server_name
      or
    •  curl -T FILE.ext ftp://server_name --user username:password

No comments:

Post a Comment