× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thank, I was missing the space.

Now the session is just hanging (input inhibited) on the QSH screen. I even
changed the GET portion to just a quit thinking it was hanging trying to get
the file but it still hangs.

The first QSH displays the password and I have to hit enter. That seems
wrong but maybe that is how this works. I'm guessing that might be the
problem with the second QSH but I have no idea what this is really doing so
I don't know what I am looking for.

Here is my batch_sftp_script.sh
export DISPLAY= SSH_ASKPASS=/QOpenSys/etc/openssh_password_script.sh
printf "quit\n" | sftp theUserID@xxxxxxxxxxxxxxxxxxxxxxxxxx

Here is my openssh_password_script.sh
#!/bin/sh
printf thePassword

Here is my CL that is running it.
QSH CMD('/QOpenSys/etc/openssh_password_script.sh')

QSH CMD('exec /QOpenSys/usr/bin/ksh -c "/ftp/batch_sftp_script.sh"')

I guess the other question that I should ask is if there is a better way to
do this (and if so, can you provide a working copy that I can adjust to what
I need)? Repeating that this is to pull PTFs from IBM's website so having
SFTP and a password (not a key) is my only option (at least that I know of).



-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jack
Woehr via MIDRANGE-L
Sent: Thursday, December 22, 2022 7:02 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: Jack Woehr <jwoehr@xxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: SFTP using password

I think your code is incorrect.

Your script should not be triggering a search for
*/QOpenSys/QIBM/ProdData/SC1/OpenSSH/libexec/ssh-askpass*

That is why (in the cited example) there is the phrase:
*export DISPLAY= SSH_ASKPASS=/QOpenSys/etc/openssh_password_script.sh *

If I had to take a *wild* guess, I'd say that if you followed the example
closely and copied this line, you left out the space after *export DISPLAY=
*and ran the equals-sign right up against the
*SSH_ASKPASS=/QOpenSys/etc/openssh_password_script.sh*

On Thu, Dec 22, 2022 at 4:45 PM <smith5646midrange@xxxxxxxxx> wrote:

I am working on a program that will do SFTP using a password and not a
key.
I have built it based on this website -

https://www.ibm.com/support/pages/batch-sftp-download-example-using-pa
ssword
-authentication
<https://www.ibm.com/support/pages/batch-sftp-download-example-using-p
assword-authentication>



When I run it, I am getting the following error



ssh_askpass:
exec(/QOpenSys/QIBM/ProdData/SC1/OpenSSH/libexec/ssh-askpass):
No such file or directory



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.