HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

SFTP batch job vs interactive

James T Horn
Frequent Advisor

SFTP batch job vs interactive

OpenVMS Alpha 8.3

When trying to do a sftp "-B" file.nam user@domain.com

from an interactive session, this command works. When trying to do it via a batch jobs, get the following error:
Failed to set terminal mode to PASTHRU in sftp.d

and it does not return any information.
Honored Contributor

Re: SFTP batch job vs interactive

There's an existing discussion of using sftp from batch:


Also see the sftp batch stuff in the http://h71000.www7.hp.com/doc/83final/ba548_90007/ba548_90007.pdf ssh manual and in the release notes.

A variant solution (and which you're aware of) involves pseudo-terminals.


And in various implementations of the sftp client on various platforms, switching to batch mode explicitly disallows prompting for the password; you have to switch away from passwords to use this.
John Gillings
Honored Contributor

Re: SFTP batch job vs interactive


SSH (and I presume SFTP) make assumptions about their environment which aren't always true. Try preceeding your command with


I find this is necessary when executing SSH commands from a command procedure. I'm guessing it's the same for SFTP.
A crucible of informative mistakes