Winscp failing to connect from Win2016 Server

Advertisement

jima
Joined:
Posts:
3
Location:
Indiana

Winscp failing to connect from Win2016 Server

Trying to setup Winscp to run from batch file and upload file to vendor sftp site. Simple batch file:
start c:\winscp\winscp.exe /console /script=upload2.txt /log="g:\upload.log"

the script file has this in it:
open sftp://USERNAME:Password@VENDOR SITE/ -hostkey="ssh-dss 1024 9yhLnt/T9tfWZc10LbZsWefPPNMp3cDlqULcyOXdefE="

This works fine from a regular workstations running Windows 7,8 or 10.
The log file from the server gives me this:

. 2019-09-17 08:13:35.102 Session name: USERNAME@Vendor Site (Ad-Hoc site)
. 2019-09-17 08:13:35.102 Host name: Vendor Site (Port: 22)
. 2019-09-17 08:13:35.102 User name: Username (Password: Yes, Key file: No, Passphrase: No)
. 2019-09-17 08:13:35.102 Tunnel: No
. 2019-09-17 08:13:35.102 Transfer Protocol: SFTP
. 2019-09-17 08:13:35.102 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2019-09-17 08:13:35.102 Disable Nagle: No
. 2019-09-17 08:13:35.102 Proxy: None
. 2019-09-17 08:13:35.102 Send buffer: 262144
. 2019-09-17 08:13:35.102 SSH protocol version: 2; Compression: No
. 2019-09-17 08:13:35.102 Bypass authentication: No
. 2019-09-17 08:13:35.102 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2019-09-17 08:13:35.102 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2019-09-17 08:13:35.102 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-09-17 08:13:35.102 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2019-09-17 08:13:35.102 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2019-09-17 08:13:35.102 Simple channel: Yes
. 2019-09-17 08:13:35.102 Return code variable: Autodetect; Lookup user groups: Auto
. 2019-09-17 08:13:35.102 Shell: default
. 2019-09-17 08:13:35.102 EOL: LF, UTF: Auto
. 2019-09-17 08:13:35.102 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2019-09-17 08:13:35.102 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2019-09-17 08:13:35.102 SFTP Bugs: Auto,Auto
. 2019-09-17 08:13:35.102 SFTP Server: default
. 2019-09-17 08:13:35.102 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2019-09-17 08:13:35.102 Cache directory changes: Yes, Permanent: Yes
. 2019-09-17 08:13:35.102 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2019-09-17 08:13:35.102 DST mode: Unix
. 2019-09-17 08:13:35.102 --------------------------------------------------------------------------
. 2019-09-17 08:13:35.102 Looking up host "Vendor Site" for SSH connection
. 2019-09-17 08:13:35.102 Connecting to "Vendor Site IP Address" port 22
. 2019-09-17 08:13:35.133 We claim version: SSH-2.0-WinSCP_release_5.15.4
. 2019-09-17 08:13:35.133 Network error: Software caused connection abort

How do I get around the Software Connection Abort?

I've change the real info to protect the innocent with Username, Password, Vendor Site, Vendor Site IP address

Any and All help would be appreciated.

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar

Re: RE; Re: Winscp failing to connect from Win2016 Server

Does it work, when you run the batch file manually in a normal Windows session?

Reply with quote

Advertisement

jima
Joined:
Posts:
3
Location:
Indiana

I think it has something to do with the key exchange. This is the log of the workstation where it is successful. Compare the logs. It dies at the key exchange.
. 2019-09-19 16:50:01.309 --------------------------------------------------------------------------
. 2019-09-19 16:50:01.309 WinSCP Version 5.15.2 (Build 9590) (OS 10.0.17763 - Windows 10 Enterprise)
. 2019-09-19 16:50:01.309 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2019-09-19 16:50:01.309 Log level: Normal
. 2019-09-19 16:50:01.309 Local account: SVBTNT\JAlexander
. 2019-09-19 16:50:01.309 Working directory: C:\temp
. 2019-09-19 16:50:01.309 Process ID: 8756
. 2019-09-19 16:50:01.309 Command-line: "c:\winscp\WinSCP.exe" /console=5.15.2 /consoleinstance=_13552_140 "/script=upload2.txt" "/log=c:\temp\upload.log"
. 2019-09-19 16:50:01.309 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 3/10/2019, DST End: 11/3/2019
. 2019-09-19 16:50:01.309 Login time: Thursday, September 19, 2019 4:50:01 PM
. 2019-09-19 16:50:01.309 --------------------------------------------------------------------------
. 2019-09-19 16:50:01.309 Script: Retrospectively logging previous script records:
> 2019-09-19 16:50:01.309 Script: open sftp://USERNAME:***@VENDORSITE/ -hostkey="ssh-dss 1024 9yhLnt/T9tfWZc10LbZsWefPPNMp3cDlqULcyOXdefE="
. 2019-09-19 16:50:01.309 --------------------------------------------------------------------------
. 2019-09-19 16:50:01.309 Session name: USERNAME@VENDORSITE (Ad-Hoc site)
. 2019-09-19 16:50:01.309 Host name: VENDORSITE (Port: 22)
. 2019-09-19 16:50:01.309 User name: USERNAME (Password: Yes, Key file: No, Passphrase: No)
. 2019-09-19 16:50:01.309 Tunnel: No
. 2019-09-19 16:50:01.309 Transfer Protocol: SFTP
. 2019-09-19 16:50:01.309 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2019-09-19 16:50:01.309 Disable Nagle: No
. 2019-09-19 16:50:01.309 Proxy: None
. 2019-09-19 16:50:01.309 Send buffer: 262144
. 2019-09-19 16:50:01.309 SSH protocol version: 2; Compression: No
. 2019-09-19 16:50:01.309 Bypass authentication: No
. 2019-09-19 16:50:01.309 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2019-09-19 16:50:01.309 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2019-09-19 16:50:01.309 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-09-19 16:50:01.309 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2019-09-19 16:50:01.309 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2019-09-19 16:50:01.309 Simple channel: Yes
. 2019-09-19 16:50:01.309 Return code variable: Autodetect; Lookup user groups: Auto
. 2019-09-19 16:50:01.309 Shell: default
. 2019-09-19 16:50:01.309 EOL: LF, UTF: Auto
. 2019-09-19 16:50:01.309 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2019-09-19 16:50:01.309 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2019-09-19 16:50:01.309 SFTP Bugs: Auto,Auto
. 2019-09-19 16:50:01.309 SFTP Server: default
. 2019-09-19 16:50:01.309 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2019-09-19 16:50:01.309 Cache directory changes: Yes, Permanent: Yes
. 2019-09-19 16:50:01.309 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2019-09-19 16:50:01.309 DST mode: Unix
. 2019-09-19 16:50:01.309 --------------------------------------------------------------------------
. 2019-09-19 16:50:01.309 Looking up host "VENDORSITE" for SSH connection
. 2019-09-19 16:50:01.309 Connecting to 65.213.167.80 port 22
. 2019-09-19 16:50:01.340 We claim version: SSH-2.0-WinSCP_release_5.15.2
. 2019-09-19 16:50:01.481 Server version: SSH-2.0-9.99 sshlib: 8.0.0.2
. 2019-09-19 16:50:01.481 Using SSH protocol version 2
. 2019-09-19 16:50:01.481 Have a known host key of type dss
. 2019-09-19 16:50:01.496 Doing Diffie-Hellman group exchange
. 2019-09-19 16:50:01.558 Doing Diffie-Hellman key exchange with hash SHA-1
. 2019-09-19 16:50:01.683 Host key fingerprint is:
. 2019-09-19 16:50:01.683 ssh-dss 1024 a9:e7:2d:8c:5e:36:00:e8:3a:6a:4f:d3:a6:5e:29:e2 9yhLnt/T9tfWZc10LbZsWefPPNMp3cDlqULcyOXdefE=
. 2019-09-19 16:50:01.683 Host key matches cached key
. 2019-09-19 16:50:01.683 Initialised AES-256 SDCTR client->server encryption
. 2019-09-19 16:50:01.683 Initialised HMAC-SHA1 client->server MAC algorithm
. 2019-09-19 16:50:01.683 Initialised AES-256 SDCTR server->client encryption
. 2019-09-19 16:50:01.683 Initialised HMAC-SHA1 server->client MAC algorithm
! 2019-09-19 16:50:01.762 Using username "USERNAME".
. 2019-09-19 16:50:01.793 Server offered these authentication methods: publickey,password
. 2019-09-19 16:50:01.793 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2019-09-19 16:50:01.793 Using stored password.
. 2019-09-19 16:50:01.793 Sent password
. 2019-09-19 16:50:02.137 Access granted
. 2019-09-19 16:50:02.137 Opening session as main channel
. 2019-09-19 16:50:02.199 Opened main channel
. 2019-09-19 16:50:02.277 Started a shell/command
. 2019-09-19 16:50:02.277 --------------------------------------------------------------------------
. 2019-09-19 16:50:02.277 Using SFTP protocol.
. 2019-09-19 16:50:02.277 Doing startup conversation with host.
> 2019-09-19 16:50:02.277 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2019-09-19 16:50:02.308 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2019-09-19 16:50:02.308 SFTP version 3 negotiated.
. 2019-09-19 16:50:02.308 We believe the server has signed timestamps bug
. 2019-09-19 16:50:02.308 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2019-09-19 16:50:02.308 Getting current directory name.
. 2019-09-19 16:50:02.308 Getting real path for '.'
> 2019-09-19 16:50:02.308 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2019-09-19 16:50:02.340 Type: SSH_FXP_NAME, Size: 47, Number: 16
. 2019-09-19 16:50:02.340 Real path is '/Home/USERNAME'
. 2019-09-19 16:50:02.340 Startup conversation with host finished.
< 2019-09-19 16:50:02.340 Script: Active session: [1] USERNAME@VENDORSITE
> 2019-09-19 16:50:02.340 Script: lcd C:\Arubaimage\FILE
< 2019-09-19 16:50:02.340 Script: C:\Arubaimage\FILE
> 2019-09-19 16:50:02.340 Script: cd /Home/USERNAME
. 2019-09-19 16:50:02.340 Changing directory to "/Home/USERNAME".
. 2019-09-19 16:50:02.340 Getting real path for '/Home/USERNAME'
> 2019-09-19 16:50:02.340 Type: SSH_FXP_REALPATH, Size: 22, Number: 272
< 2019-09-19 16:50:02.387 Type: SSH_FXP_NAME, Size: 47, Number: 272
. 2019-09-19 16:50:02.387 Real path is '/Home/USERNAME'
. 2019-09-19 16:50:02.387 Trying to open directory "/Home/USERNAME".
> 2019-09-19 16:50:02.387 Type: SSH_FXP_LSTAT, Size: 22, Number: 519
< 2019-09-19 16:50:02.418 Type: SSH_FXP_ATTRS, Size: 37, Number: 519
. 2019-09-19 16:50:02.418 Getting current directory name.
< 2019-09-19 16:50:02.418 Script: /Home/USERNAME
> 2019-09-19 16:50:02.418 Script: put *.FILE
. 2019-09-19 16:50:02.418 Copying 1 files/directories to remote directory "/Home/USERNAME" - total size: 23,039
. 2019-09-19 16:50:02.418 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask:
. 2019-09-19 16:50:02.418 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; EncryptNewFiles: Yes; ExcludeHiddenFiles: No; ExcludeEmptyDirectories: No; InclM: ; ResumeL: 0
. 2019-09-19 16:50:02.418 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2019-09-19 16:50:02.418 Getting real path for '/Home/USERNAME'
> 2019-09-19 16:50:02.418 Type: SSH_FXP_REALPATH, Size: 22, Number: 784
< 2019-09-19 16:50:02.465 Type: SSH_FXP_NAME, Size: 47, Number: 784
. 2019-09-19 16:50:02.465 Real path is '/Home/USERNAME'
. 2019-09-19 16:50:02.465 File: '083909445ATMQSI20190919163604.FILE' [2019-09-

Reply with quote E-mail

martin
Site Admin
martin avatar

No, it dies well before the key exchange. No data ever arrives from the server.
It's likely a firewall issue.
Can you SSH to that server from the Win2016 Server any way? WinSCP GUI? Any other SSH/SFTP client?

Reply with quote

Advertisement

You can post new topics in this forum