Operating System - OpenVMS
1752321 Members
5183 Online
108786 Solutions
New Discussion юеВ

SFTP batch file problems

 
SOLVED
Go to solution
robert70
Valued Contributor

SFTP batch file problems

Trying to SFTP2 using this command

sftp2 "-B"zxc.ftp egduser@128.8.204.122

zxc.ftp contains one line
'password'

Manually this works fine eg

sftp2 egduser@128.8.204.122
type in the password and you are logged in
batch gives this error.......

DAVE$ sftp2 "-B"zxc.ftp egduser@128.8.204.122

FATAL: ssh2 client failed to authenticate. (or you have too old ssh2 installed, check with ssh2 "-V")

warning: Authentication failed.
Disconnected; no more authentication methods available (No further authenticatio
n methods available.).


%TCPIP-F-SSH_FATAL, non-specific fatal error condition
DAVE$



SSH2 "-V" gives

dave$dkb0:[sys0.syscommon.][sysexe]tcpip$ssh_ssh2.exe: SSH Secure Shell OpenVMS
(V5.5) 3.2.0 on COMPAQ AlphaServer DS20E 666 MHz - VMS V7.3-2

any help please
thanks robert
5 REPLIES 5
Martin Vorlaender
Honored Contributor
Solution

Re: SFTP batch file problems

Robert,

password entry only works interactively.

To use SSH/SCP/SFTP in batch, you have to establish an authentication without password, e.g. using public/private keys.

HTH,
Martin
robert70
Valued Contributor

Re: SFTP batch file problems

Thanks Martin,
Total Novice at all of this
How would I go about such a setup?
Martin Vorlaender
Honored Contributor

Re: SFTP batch file problems

Robert,

setting up public/private key authorization is described for HP TCP/IP services at http://h71000.www7.hp.com/doc/732final/aa-rvbua-te/00/00/24-con.html under "Customizing Public-Key Authentication". For OpenSSH (the variant used by various Unixes) see http://sial.org/howto/openssh/publickey-auth/

To use the ssh_keygen tool (note the underscore instead of the hyphen used in Unix), you'll have to define some foreign commands using

$ @SYS$MANAGER:TCPIP$DEFINE_COMMANDS.COM

Another complication stems from the fact that VMS SSH is NOT derived from OpenSSH, but instead is a port of the commercial implementation. The two products use a different file format to store keys. Unfortunately, the VMS ssh_keygen tool lacks the ability to convert the public key to OpenSSH format (should your Non-VMS server use that), so you'll have to do that on the server, using

# ssh-keygen -i -f vms-format-key > openssh-format-key

HTH,
Martin
Hoff
Honored Contributor

Re: SFTP batch file problems

Here's the basic sequence for no-password login for a Unix box accessing an OpenVMS box via ssh:

http://labs.hoffmanlabs.com/node/1118

For your specific purposes here, the ssh manual is what you want to read.
robert70
Valued Contributor

Re: SFTP batch file problems

thanks