This question was already answered in this forum.
Here is a link to the answer
Essentially all sftp clients will prompt for profile and password — if they can. One difficulty is that sftp isn’t actually written for AS/400s; they don’t really understand how 5250 workstations work. They expect a Unix-like terminal behavior. Here’s <a href=”http://archive.midrange.com/midrange-l/200812/msg01193.html”>a summary of the problem</a> from Walt Madden, an IBMer involved with PASE and related technologies.
Somewhere I once ran across a way to define 5250 sessions to PASE (maybe even QShell, but I’m not sure that’s very likely) so that they could be used for at least some Unix-y functions. It’d take some focused and possibly detailed searches to find it if it’s still on-line anywhere.
But maybe this series will help with the alternative:
<li><a href=”http://archive.midrange.com/midrange-l/200812/msg01209.html”>One guy got sftp to work in batch</a></li><li><a href=”http://archive.midrange.com/midrange-l/200611/msg00856.html”>His inspiration</a></li><li><a href=”http://archive.midrange.com/midrange-l/200609/msg01523.html”>The gritty details</a></li>
The <a href=”http://www.redbooks.ibm.com/redpapers/pdfs/redp4163.pdf”>Securing Communications with OpenSSH on IBM i5/OS</a> Redpaper that is referenced in the last item has a few more useful comments on the problem of sftp passwords under i5/OS.
Now, if you really, really want to continue along the way to userid and password rather than going the certificates route, your best bet might be with running “expect” scripts. Here’s a basic <a href=”http://archive.midrange.com/midrange-l/200808/msg00994.html”>guide to installing expect (and tcl)</a> under i5/OS.
When you can’t find info about how to use those or run into scripting or programming bugs, post a new question.