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.
Hours:
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
cancel
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
TCPIP V5.6

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.
2 REPLIES
Hoff
Honored Contributor

Re: SFTP batch job vs interactive

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

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=985928

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.

http://groups.google.com/group/comp.os.vms/browse_thread/thread/935cb20e7ca233c1/e81df2ace8ab8835

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

James,

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

$ DEFINE/USER SYS$COMMAND NL:

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