Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > Red Hat Enterprise Linux 5 > Issue <<  286 of 346 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 12752
Last update: 05-16-08
Issue:
How do you upload a file to an ftp server without interactive prompting?
Resolution:

Release Found: Red Hat Enterprise Linux 5

Solution:

In this example, assume that ftp server's IP address is 10.66.0.92, and the username testuser with password testpasswd has been created on ftp server. . The file in this example that needs to be uploaded is uploadfile.tar.gz, located in current directory.

  1. Create a new file in current directory named ftpscriptfile. Include the following lines into the file.

    open 10.66.0.92
    user testuser testpasswd
    binary
    put uploadfile.tar.gz

  2. Issue command: ftp -inv < ftpscriptfile
    $ftp -inv < ftpscriptfile 
    Connected to 10.66.0.92.
    220 (vsFTPd 2.0.5)
    530 Please login with USER and PASS.
    530 Please login with USER and PASS.
    KERBEROS_V4 rejected as an authentication type
    331 Please specify the password.
    230 Login successful.
    200 Switching to Binary mode.
    local: uploadfile.tar.gz remote: uploadfile.tar.gz
    227 Entering Passive Mode (10,66,0,92,213,132)
    150 Ok to send data.
    226 File receive OK.
    191 bytes sent in 6.1e-05 seconds (3.1e+03 Kbytes/s)
    221 Goodbye.

The file uploadfile.tar.gz has been uploaded.


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > Red Hat Enterprise Linux 5 > Issue <<   286  of  346  >>