AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Unattended sftp

    Posted Tue March 29, 2022 12:20 PM

    We need to run unattended sftp several times a day.

    We are running AIX 7200-04-02 with minimal (what is provided with the AIX install) open-source packages.

    OpenSSH and OpenSSL were installed from the 7200-04-02 media (the IBM version of OpenSSH 1.0.2t).

     

    Most of our vendors are not using identifier info – all they want are username and password.

    It appears that sftp as supplied does not offer/support password utilization.

     

    I've seen suggestions to use expect or sshpass, neither of which is currently installed.

    Both are available from IBM Toolbox.

     

    Has anyone else had this need, and how did you supply it?

     

    Regards,

     

    Bob W.

     



  • 2.  RE: Unattended sftp

    Posted Tue March 29, 2022 01:12 PM
    On Tue, Mar 29, 2022 at 04:20:09PM +0000, Bob Wyatt via IBM Community wrote:
    > We need to run unattended sftp several times a day.
    > We are running AIX 7200-04-02 with minimal (what is provided with the AIX install) open-source packages.
    > OpenSSH and OpenSSL were installed from the 7200-04-02 media (the IBM version of OpenSSH 1.0.2t).
    >
    > Most of our vendors are not using identifier info ??? all they want are username and password.
    > It appears that sftp as supplied does not offer/support password utilization.

    SSH keys would be preferred. Make a strong keypair, send them the
    public key to assign to your account.

    > I've seen suggestions to use expect or sshpass, neither of which is currently installed.
    > Both are available from IBM Toolbox.

    expect should be installed by default. I just checked a 7.2 server,
    and though it's packaged as an RPM, I'm pretty sure it's from the base
    OS. We did not install that RPM as there is a strict policy of as few
    OSS packages as possible.

    You could also look at using a batchfile of commands (sftp -b
    filename). You could potentially use a here document in a shell script
    too with '-b -'.

    ------------------------------------------------------------------
    Russell Adams Russell.Adams@AdamsSystems.nl
    Principal Consultant Adams Systems Consultancy
    http://adamssystems.nl/




  • 3.  RE: Unattended sftp

    Posted Tue March 29, 2022 02:30 PM
    I use the sshpass to allow Ansible to connect with my managed systems before key exchanges are possible. Because sshpass is designed to be used with the ssh suite, I would expect that to have a quicker time-to-value for you. Also, sshpass is an already-integrated solution should you have a need for Ansible in the future.

    Good luck,

    -- 
    Stephen L. Ulmer
    Enterprise Architect
    Mainline Information Systems
    (m) 352-870-8649








  • 4.  RE: Unattended sftp

    Posted Wed March 30, 2022 09:29 AM
    expect is provided with base AIX. You can use expect scripts. 
    You can verify if expect is installed by running

    lslpp -l | grep expect 
    or
    by running /usr/bin/expect

    ------------------------------
    SANKET RATHI
    ------------------------------