System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting sftp with password in batch mode

 
Highlighted
Super Advisor

Scripting sftp with password in batch mode

I'm attempting to automate an sftp process, but have been unable to provide the password that works interactively.

The remote server is not ours and we would prefer to solve this without further involving the other party if at all possible.

But every attempt I've made, reading and following various other articles in this forum, has failed. I've run it with debugging on and if -b or BatchMode Yes is given, no attempt is made to read the password from stdin or the batch file. It appears that authentication must complete before the batch file or stdin is read for commands.

Is that the final word? Is there no way to non-interactively supply a password?

This is HP-UX 11.11
SSH is " T1471AA A.04.30.002 HP-UX Secure Shell"
2 REPLIES 2
Highlighted
Honored Contributor

Re: Scripting sftp with password in batch mode

> Is that the final word? Is there no way to
> non-interactively supply a password?

It's hardly a non-existence proof, but I
don't think that there is. There's a strong
argument to be made that any scheme which
allows (or encourages) a password to be
stored in a file is inherently insecure.

I thought that the normal way to deal with
this sort of requirement was to use
public-key authorization with a no-passphrase
key. Or host-based authorization. Or any
other possible scheme which didn't actually
require a password to be supplied.

> This is HP-UX 11.11

So perhaps an HP-UX forum would be a better
place for this question than this Linux
forum.
Highlighted
Super Advisor

Re: Scripting sftp with password in batch mode

Oops! I was reading articles for OpenVMS, Linux, and HP-UX, and thought I was replying to one of the HP-UX onces when I wrote the post.

Mods, feel free to delete this thread if you like...