1822158 Members
3485 Online
109640 Solutions
New Discussion юеВ

sftp on openvms

 
Joseph Huber_1
Honored Contributor

Re: sftp on openvms

So we all agree that ssh/sftp command-line argument parsing is suboptimal,
back to topic:

CHANDRASEKARAN , do a verbose sftp:
sftp -"v" user@host
The resulting output should show at which point the error occurs.
http://www.mpp.mpg.de/~huber
Steven Schweda
Honored Contributor

Re: sftp on openvms

> what does "SHOW SYMBOL SFTP" return ?

Don't forget "show logical DCL$PATH".
Jay So
Occasional Advisor

Re: sftp on openvms

Hi,

If you're missing SFTP as symbol, that's normal. However, you can have it defined for you by invoking @SYS$MANAGER:TCPIP$DEFINE_COMMANDS.COM

$ sftp*2 :== $'f$edit("sys$system:tcpip$ssh_sftp2.exe","upcase")'

And here's an example of using BATCH mode SFTP.

$ SET VERIFY
$! SFTP_BATCH.COM to submit SFTP to batch
$!
$! Set default to where SFTP.INPUT is located, otherwise,
$! SFTP command would have to use full path in unix style:
$! i.e. /sys$sysdevice/h_so/test/sftp.input
$ set def SYS$SYSDEVICE:[H_SO.TEST]
$!
$! Following gets output of the sftp commands to the log, without it,
$! none of the sftp output will be logged:
$ define/user sys$input sys$command
$!
$! The following logicals were for various tests:
$! define/process sys$output SYS$SYSDEVICE:[H_SO.TEST]sftp.output
$! define/process sys$error SYS$SYSDEVICE:[H_SO.TEST]sftp.output
$!
$! Following is the correct syntax for 5.4 ECO5 and higher:
$ sftp -"B" sftp.input localhost
$!
$! Following is the correct syntax for 5.4 ECO4 and below:
$! sftp -b sftp.input localhost
$!
$ exit

Where SFTP.INPUT file contains the following:
pwd
ls
get foosadjfhlo.txt
quit


Also note that SFTP.INPUT could contain multiple
open
close

with sftp commands inbetween:
i.e.
open host1
ls
get myfile.txt
close
open host2
get yourfile.txt
close
open host3
put myfile.txt yourfile.txt
close
quit

Regards,

Jay So
Jay So
Occasional Advisor

Re: sftp on openvms

I forgot to mention that ssh/sftp/scp in BATCH mode REQUIRES "passwordless" authentication such as publickey or hostbased:

From Tru64 Uninx # man SFTP

-B batchfile
Reads commands from a file instead of standard input. Because this mode
is intended for scripts or cron jobs, the sftp2 command will not try to
interact with the user, which means that only authentication methods
that do not use passwords will work. In batch mode, a failure to
change the current working directory will cause the sftp2 command to
abort. Other errors are ignored.

I believe this also means that keys with passphrases will also not work with batch mode...