[HPADM] Non-Interactive SFTP

From: Naylor, Jim (Jnaylor_at_Schnucks.com)
Date: 04/25/03

  • Next message: rex ind: "[HPADM] Help me"
    Date: Fri, 25 Apr 2003 12:47:00 -0500
    To: "Hpux-Admin@Dutchworks. Nl (E-mail)" <hpux-admin@dutchworks.nl>
    
    

    Hello All,
    According to the man pages on SFTP you can use the -b to automate SFTP. The
    -b points to a command file that has the sftp commands. Has anyone been
    able to get SFTP to work in a script form like ftp. We do the following for
    ftp automation:

    echo "user username password" > ftpfile
    echo "cd abcd" >> ftpfile
    echo "get filename" >> ftpfile
    echo "bye" >> ftpfile

    ftp ftpsite < ftpfile

    I have tried to do something similar with SFTP but cannot seem to get it to
    work. This script needs to be run by a user other than the sftp login user.
    According to the man pages I would have to do sftp username@sftpserver. Any
    ideas would be appreciated.

    HPUX 11.0 on rp7400

    Thanks,
    Jim Naylor
    Unix Systems Administrator
    Schnuck Markets, Inc.
    * Direct: (314) 994-4784
    *)) Cell: (314) 691-0186
    * Fax : (314) 994-4684
    * jnaylor@schnucks.com

    --
                 ---> Please post QUESTIONS and SUMMARIES only!! <---
            To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
           Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
     
     Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
                http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)
    

  • Next message: rex ind: "[HPADM] Help me"

    Relevant Pages

    • Non-Interactive SFTP
      ... According to the man pages on SFTP you can use the -b to automate SFTP. ... -b points to a command file that has the sftp commands. ... echo "user username password"> ftpfile ...
      (AIX-L)
    • Re: Non-Interactive SFTP
      ... Subject: Non-Interactive SFTP ... able to get SFTP to work in a script form like ftp. ... echo "user username password"> ftpfile ...
      (AIX-L)
    • Re: Ssh and sftp via here document
      ... The file transfer is performed by sftp during an ssh session ... storing cleartext passwords in the script. ... Note that echo 3 and echo 4 do not appear; ... Everything works as I expect when I issue the ssh and sftp commands ...
      (comp.unix.shell)
    • Re: How to filter string for words that meet a certain criteria?
      ... an "ls" of the files that meet the the criteria of $and saves ... sftp> exit ... Here is some sample output of the string being returned. ... I don't use sftp so I don't know if there's a builtin way of suppressing that automatic echo, but I bet if you quote your output variable properly you'll see an easy way to separate those batchfile echos from the real output. ...
      (comp.unix.shell)
    • Re: Anybody know about SFTP running in a script and getting a directory listing ?
      ... >echo or grep commands. ... don't do "echo" on the SFTP prompt. ...
      (comp.unix.shell)