Using the WinSCP GUI, I can authenticate with my server and transfer files. And I have:
Session -> Generate Session URL/Code... -> Script -> Script file
..then
Copy to Clipboard, and saved to "ModCopy.txt". I then set up
ModCopy.bat with instructions to produce a log file.
Here is the batch file:
"C:\Users\Dan\AppData\Local\Programs\WinSCP\WinSCP.exe" /log="I:\phpBB\repository\ModCopy.log" /ini=nul /script="I:\phpBB\repository\ModCopy.txt"
Here is the
open
portion of the script (with edits to protect confidential info):
open sftp://webuser:mypass@127.0.0.1:nnnn/ -hostkey="ssh-ed25519 255 [snipped encryption string]" -rawsettings AuthKI=0 Cipher="aes,chacha20,3des,WARN,des,blowfish,arcfour" Tunnel=1 TunnelHostName="myvps.myisp.com" TunnelPortNumber=nnnn TunnelUserName="myssllogin" TunnelPublicKeyFile="I:%5CSSH_Keys%5Cprivate.ppk"
Here is what is reported in the log file (again, with edits consistent with the edits above):
< 2021-07-17 10:54:18.496 Script: Opening tunnel...
. 2021-07-17 10:54:18.496 Opening tunnel.
. 2021-07-17 10:54:18.497 Autoselected tunnel local port number 50027
< 2021-07-17 10:54:18.497 Script: Searching for host...
. 2021-07-17 10:54:18.498 [Tunnel] Looking up host "myvps.myisp.com" for SSH connection
. 2021-07-17 10:54:18.504 [Tunnel] Connecting to NNN.NNN.NNN.NNN port nnnn
< 2021-07-17 10:54:18.512 Script: Connecting to host...
. 2021-07-17 10:54:18.512 [Tunnel] We claim version: SSH-2.0-WinSCP_release_5.19
. 2021-07-17 10:54:18.530 [Tunnel] Remote version: SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
. 2021-07-17 10:54:18.530 [Tunnel] Using SSH protocol version 2
. 2021-07-17 10:54:18.540 [Tunnel] Doing ECDH key exchange with curve Curve25519 and hash SHA-256
. 2021-07-17 10:54:18.638 [Tunnel] Server also has ecdsa-sha2-nistp256/ssh-rsa host keys, but we don't know any of them
. 2021-07-17 10:54:18.639 [Tunnel] Host key fingerprint is:
. 2021-07-17 10:54:18.639 [Tunnel] ssh-ed25519 255 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx [snipped encryption string]
< 2021-07-17 10:54:18.639 Script: Authenticating...
. 2021-07-17 10:54:18.639 Error opening tunnel.
. 2021-07-17 10:54:18.639 [Tunnel] Closing connection.
< 2021-07-17 10:54:18.640 Script: Expected host key was not configured, use -hostkey switch.
< 2021-07-17 10:54:18.640 Host key fingerprint is ssh-ed25519 255 [snipped encryption string].
< 2021-07-17 10:54:18.640 Authentication failed.
I did not find
"Expected host key was not configured" in the list of common error messages.