04-10-2012 11:56 AM
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"
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.
Solved! Go to Solution.
04-10-2012 12:52 PM
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.
04-10-2012 02:32 PM
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.)