SFTP in batch not working (965 Views)
Reply
Advisor
Tschroeder
Posts: 23
Registered: ‎10-16-2006
Message 1 of 6 (965 Views)
Accepted Solution

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.

Honored Contributor
Steven Schweda
Posts: 9,089
Registered: ‎02-23-2005
Message 2 of 6 (961 Views)

Re: SFTP in batch not working

Honored Contributor
Hoff
Posts: 4,946
Registered: ‎01-29-2006
Message 3 of 6 (958 Views)

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
Tschroeder
Posts: 23
Registered: ‎10-16-2006
Message 4 of 6 (952 Views)

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
Steven Schweda
Posts: 9,089
Registered: ‎02-23-2005
Message 5 of 6 (945 Views)

Re: SFTP in batch not working

Honored Contributor
Hoff
Posts: 4,946
Registered: ‎01-29-2006
Message 6 of 6 (942 Views)

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.)

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.