Showing results for 
Search instead for 
Do you mean 

SFTP in batch not working

SOLVED
Go to Solution
Advisor

SFTP in batch not working

I can use SFTP interactively just fine to connect to a client's FTP site.   To do this I created a user on my system with the same name as the FTP user on the client's server, then when logged in as the new user, I use the following command.

 

$ SFTP ftp.clientsaddress.com

 

It prompts me for  a password and I login just fine.   To do this in batch mode, I created a text file pwd.txt with the password in it.   Then logged in as that same user, I issue the following command:

 

$ SFTP "-B" pwd.txt  ftp.clientsaddress.com

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

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

 

I have checked the ssh2 version:

 

$ ssh2 "-V"
alpha2$dke0:[sys0.syscommon.][sysexe]tcpip$ssh_ssh2.exe: SSH Secure Shell OpenVMS (V5.5) 3.2.0 on AlphaServer DS25 - VMS V8.3

 

Other version info:


  HP TCP/IP Services for OpenVMS Alpha Version V5.6
  on an AlphaServer DS25 running OpenVMS V8.3

 

 

Any help would be appreciated.

5 REPLIES
Honored Contributor Honored Contributor

Re: SFTP in batch not working

 
Honored Contributor Honored Contributor

Re: SFTP in batch not working

Using sftp to connect to an ftp site won't work.  I'll assume that a connection to an sftp server was intended.

 

The file specification after the -B isn't a file containing a password, it's a file containing sftp transfer commands.

 

(And quoting from the HP documentation for this sftp stuff: "SYS$INPUT, SYS$OUTPUT, and SYS$ERROR may not work as you expect."  They definitely don't.)

 

If you want to use sftp in batch, then you will want to set up the certificate-based login path.  Some details on setting up the sftp and ssh and the rest of the certificate-based operations are here and here and here.

 

 

 

Advisor

Re: SFTP in batch not working

Thanks for the info. I will talk to my client and see if they want to setup an exchange of public keys. If so, I will have to figure out how to create those in OpenVMS
Honored Contributor Honored Contributor

Re: SFTP in batch not working

 
Highlighted
Honored Contributor Honored Contributor

Re: SFTP in batch not working

One of the documents that's linked is an illustrated description of how to set up a certificate-based login, and it's specifically tailored for Microsoft Windows users working with PuTTY terminal emulator.  It also covers OS X as a client, which uses OpenSSL.  (OpenVMS also uses an ancient and somewhat wonky port of OpenSSL.)