Running in batch switches the encryption cipher
I need the session to use Cipher 3aes, otherwise I get the error "Incoming packet was garbled on decryption". The batch session starts out using cipher 3aes, but then switches to aes.
Using Winscp version 4.2.8 (Build 818)
Bat file used to automatically execute the script file
cd C:\
cd c:\Program Files\WinSCP
winscp.com /script="P:\ABCPPFTP.bat" /log="C:\CNBPPLog.log"
Here is the script:ABCPPFTP.BAT
option batch abort
option confirm off
open ABC
open sftp://rdi@mmmm.abc.com -privatekey=C:\TEST@ABC.ppk
put /DIRECT/POSPAY_201010111546.TXT /rdi.toabc/PosPay_20101008.ABC
quit
close ABC
Here is the log:
2010-11-04 12:22:18.017 --------------------------------------------------------------------------
. 2010-11-04 12:22:18.017 WinSCP Version 4.2.8 (Build 818) (OS 5.2.3790 Service Pack 2)
. 2010-11-04 12:22:18.017 Login time: Thursday, November 04, 2010 12:22:18 PM
. 2010-11-04 12:22:18.017 --------------------------------------------------------------------------
. 2010-11-04 12:22:18.017 Session name: ABC
. 2010-11-04 12:22:18.017 Host name: mmmm.abc.com (Port: 22)
. 2010-11-04 12:22:18.017 User name: rdi (Password: No, Key file: Yes)
. 2010-11-04 12:22:18.017 Tunnel: No
. 2010-11-04 12:22:18.017 Transfer Protocol: SFTP (SCP)
. 2010-11-04 12:22:18.017 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2010-11-04 12:22:18.017 Proxy: none
. 2010-11-04 12:22:18.017 SSH protocol version: 2; Compression: No
. 2010-11-04 12:22:18.017 Bypass authentication: No
. 2010-11-04 12:22:18.017 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2010-11-04 12:22:18.017 Ciphers: 3des,aes,blowfish,WARN,arcfour,des; Ssh2DES: No
. 2010-11-04 12:22:18.017 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2010-11-04 12:22:18.017 SFTP Bugs: -,-
. 2010-11-04 12:22:18.017 Return code variable: Autodetect; Lookup user groups: Yes
. 2010-11-04 12:22:18.017 Shell: default
. 2010-11-04 12:22:18.017 EOL: 0, UTF: 2
. 2010-11-04 12:22:18.017 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2010-11-04 12:22:18.017 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2010-11-04 12:22:18.017 Local directory: P:\, Remote directory: /rdi.toabc, Update: No, Cache: Yes
. 2010-11-04 12:22:18.017 Cache directory changes: Yes, Permanent: Yes
. 2010-11-04 12:22:18.017 DST mode: 1
. 2010-11-04 12:22:18.017 --------------------------------------------------------------------------
. 2010-11-04 12:22:18.017 Looking up host "mmmm.abc.com"
. 2010-11-04 12:22:18.017 Connecting to 11.1.111.111 port 22
. 2010-11-04 12:22:18.376 Server version: SSH-2.0-OpenSSH_4.3
. 2010-11-04 12:22:18.376 We believe remote version has SSH-2 ignore bug
. 2010-11-04 12:22:18.376 Using SSH protocol version 2
. 2010-11-04 12:22:18.376 We claim version: SSH-2.0-WinSCP_release_4.2.8
. 2010-11-04 12:22:18.470 Doing Diffie-Hellman group exchange
. 2010-11-04 12:22:18.751 Doing Diffie-Hellman key exchange with hash SHA-1
. 2010-11-04 12:22:19.236 Host key fingerprint is:
. 2010-11-04 12:22:19.376 ssh-rsa 2048 e2:2c:8b:2e:2a:95:58:92:27:d2:98:73:f0:2d:61:3f
. 2010-11-04 12:22:19.376 Initialised triple-DES CBC client->server encryption
. 2010-11-04 12:22:19.376 Initialised HMAC-SHA1 client->server MAC algorithm
. 2010-11-04 12:22:19.376 Initialised triple-DES CBC server->client encryption
. 2010-11-04 12:22:19.376 Initialised HMAC-SHA1 server->client MAC algorithm
. 2010-11-04 12:22:19.579 Reading private key file "C:\TEST@ABC.ppk"
! 2010-11-04 12:22:19.579 Using username "rdi".
. 2010-11-04 12:22:19.689 Offered public key
. 2010-11-04 12:22:19.892 Offer of public key accepted
! 2010-11-04 12:22:19.892 Authenticating with public key "rsa-key-20100924"
. 2010-11-04 12:22:20.345 Access granted
. 2010-11-04 12:22:20.454 Opened channel for session
. 2010-11-04 12:22:20.783 Started a shell/command
. 2010-11-04 12:22:20.783 --------------------------------------------------------------------------
. 2010-11-04 12:22:20.783 Using SFTP protocol.
. 2010-11-04 12:22:20.783 Doing startup conversation with host.
> 2010-11-04 12:22:20.783 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2010-11-04 12:22:21.126 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2010-11-04 12:22:21.126 SFTP version 3 negotiated.
. 2010-11-04 12:22:21.126 We believe the server has signed timestamps bug
. 2010-11-04 12:22:21.126 We will use UTF-8 strings for status messages only
. 2010-11-04 12:22:21.126 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2010-11-04 12:22:21.126 Changing directory to "/rdi.toabc".
. 2010-11-04 12:22:21.126 Getting real path for '/rdi.toabc'
> 2010-11-04 12:22:21.126 Type: SSH_FXP_REALPATH, Size: 33, Number: 16
< 2010-11-04 12:22:21.189 Type: SSH_FXP_NAME, Size: 69, Number: 16
. 2010-11-04 12:22:21.189 Real path is '/rdi.toabc'
. 2010-11-04 12:22:21.189 Trying to open directory "/rdi.toabc".
> 2010-11-04 12:22:21.189 Type: SSH_FXP_LSTAT, Size: 33, Number: 263
< 2010-11-04 12:22:21.267 Type: SSH_FXP_ATTRS, Size: 37, Number: 263
. 2010-11-04 12:22:21.267 Getting current directory name.
. 2010-11-04 12:22:21.267 Startup conversation with host finished.
< 2010-11-04 12:22:21.283 Script: Active session: [1] ABC
> 2010-11-04 12:22:21.283 Script: open sftp://rdi@mmmm.abc.com -privatekey=C:\TEST@ABC.ppk
. 2010-11-04 12:22:21.283 --------------------------------------------------------------------------
. 2010-11-04 12:22:21.283 WinSCP Version 4.2.8 (Build 818) (OS 5.2.3790 Service Pack 2)
. 2010-11-04 12:22:21.283 Login time: Thursday, November 04, 2010 12:22:21 PM
. 2010-11-04 12:22:21.283 --------------------------------------------------------------------------
. 2010-11-04 12:22:21.283 Session name: rdi@mmmm.abc.com
. 2010-11-04 12:22:21.283 Host name: mmmm.abc.com (Port: 22)
. 2010-11-04 12:22:21.283 User name: rdi (Password: No, Key file: Yes)
. 2010-11-04 12:22:21.283 Tunnel: No
. 2010-11-04 12:22:21.283 Transfer Protocol: SFTP
. 2010-11-04 12:22:21.283 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2010-11-04 12:22:21.283 Proxy: none
. 2010-11-04 12:22:21.283 SSH protocol version: 2; Compression: No
. 2010-11-04 12:22:21.283 Bypass authentication: No
. 2010-11-04 12:22:21.283 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2010-11-04 12:22:21.283 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2010-11-04 12:22:21.283 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2010-11-04 12:22:21.283 SFTP Bugs: -,-
. 2010-11-04 12:22:21.283 Return code variable: Autodetect; Lookup user groups: Yes
. 2010-11-04 12:22:21.283 Shell: default
. 2010-11-04 12:22:21.283 EOL: 0, UTF: 2
. 2010-11-04 12:22:21.283 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2010-11-04 12:22:21.283 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2010-11-04 12:22:21.283 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-11-04 12:22:21.283 Cache directory changes: Yes, Permanent: Yes
. 2010-11-04 12:22:21.283 DST mode: 1
. 2010-11-04 12:22:21.283 --------------------------------------------------------------------------
< 2010-11-04 12:22:21.283 Script: Searching for host...
. 2010-11-04 12:22:21.283 Looking up host "mmmm.abc.com"
. 2010-11-04 12:22:21.283 Connecting to 12.9.150.100 port 22
< 2010-11-04 12:22:21.314 Script: Connecting to host...
. 2010-11-04 12:22:21.486 Server version: SSH-2.0-OpenSSH_4.3
. 2010-11-04 12:22:21.486 We believe remote version has SSH-2 ignore bug
. 2010-11-04 12:22:21.486 Using SSH protocol version 2
. 2010-11-04 12:22:21.486 We claim version: SSH-2.0-WinSCP_release_4.2.8
. 2010-11-04 12:22:21.533 Doing Diffie-Hellman group exchange
. 2010-11-04 12:22:21.798 Doing Diffie-Hellman key exchange with hash SHA-1
< 2010-11-04 12:22:21.970 Script: Authenticating...
. 2010-11-04 12:22:21.970 Host key fingerprint is:
. 2010-11-04 12:22:21.970 ssh-rsa 2048 e2:2c:8b:2e:2a:95:58:92:27:d2:98:73:f0:2d:61:3f
. 2010-11-04 12:22:21.970 Initialised AES-256 SDCTR client->server encryption
. 2010-11-04 12:22:21.970 Initialised HMAC-SHA1 client->server MAC algorithm
. 2010-11-04 12:22:21.970 Initialised AES-256 SDCTR server->client encryption
. 2010-11-04 12:22:21.970 Initialised HMAC-SHA1 server->client MAC algorithm
. 2010-11-04 12:22:22.220 Incoming packet was garbled on decryption
. 2010-11-04 12:22:22.236 Script: Failed
. 2010-11-04 12:22:22.236 Closing connection.
. 2010-11-04 12:22:22.236 Sending special code: 12
. 2010-11-04 12:22:22.236 Sent EOF message
Using Winscp version 4.2.8 (Build 818)
Bat file used to automatically execute the script file
cd C:\
cd c:\Program Files\WinSCP
winscp.com /script="P:\ABCPPFTP.bat" /log="C:\CNBPPLog.log"
Here is the script:ABCPPFTP.BAT
option batch abort
option confirm off
open ABC
open sftp://rdi@mmmm.abc.com -privatekey=C:\TEST@ABC.ppk
put /DIRECT/POSPAY_201010111546.TXT /rdi.toabc/PosPay_20101008.ABC
quit
close ABC
Here is the log:
2010-11-04 12:22:18.017 --------------------------------------------------------------------------
. 2010-11-04 12:22:18.017 WinSCP Version 4.2.8 (Build 818) (OS 5.2.3790 Service Pack 2)
. 2010-11-04 12:22:18.017 Login time: Thursday, November 04, 2010 12:22:18 PM
. 2010-11-04 12:22:18.017 --------------------------------------------------------------------------
. 2010-11-04 12:22:18.017 Session name: ABC
. 2010-11-04 12:22:18.017 Host name: mmmm.abc.com (Port: 22)
. 2010-11-04 12:22:18.017 User name: rdi (Password: No, Key file: Yes)
. 2010-11-04 12:22:18.017 Tunnel: No
. 2010-11-04 12:22:18.017 Transfer Protocol: SFTP (SCP)
. 2010-11-04 12:22:18.017 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2010-11-04 12:22:18.017 Proxy: none
. 2010-11-04 12:22:18.017 SSH protocol version: 2; Compression: No
. 2010-11-04 12:22:18.017 Bypass authentication: No
. 2010-11-04 12:22:18.017 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2010-11-04 12:22:18.017 Ciphers: 3des,aes,blowfish,WARN,arcfour,des; Ssh2DES: No
. 2010-11-04 12:22:18.017 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2010-11-04 12:22:18.017 SFTP Bugs: -,-
. 2010-11-04 12:22:18.017 Return code variable: Autodetect; Lookup user groups: Yes
. 2010-11-04 12:22:18.017 Shell: default
. 2010-11-04 12:22:18.017 EOL: 0, UTF: 2
. 2010-11-04 12:22:18.017 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2010-11-04 12:22:18.017 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2010-11-04 12:22:18.017 Local directory: P:\, Remote directory: /rdi.toabc, Update: No, Cache: Yes
. 2010-11-04 12:22:18.017 Cache directory changes: Yes, Permanent: Yes
. 2010-11-04 12:22:18.017 DST mode: 1
. 2010-11-04 12:22:18.017 --------------------------------------------------------------------------
. 2010-11-04 12:22:18.017 Looking up host "mmmm.abc.com"
. 2010-11-04 12:22:18.017 Connecting to 11.1.111.111 port 22
. 2010-11-04 12:22:18.376 Server version: SSH-2.0-OpenSSH_4.3
. 2010-11-04 12:22:18.376 We believe remote version has SSH-2 ignore bug
. 2010-11-04 12:22:18.376 Using SSH protocol version 2
. 2010-11-04 12:22:18.376 We claim version: SSH-2.0-WinSCP_release_4.2.8
. 2010-11-04 12:22:18.470 Doing Diffie-Hellman group exchange
. 2010-11-04 12:22:18.751 Doing Diffie-Hellman key exchange with hash SHA-1
. 2010-11-04 12:22:19.236 Host key fingerprint is:
. 2010-11-04 12:22:19.376 ssh-rsa 2048 e2:2c:8b:2e:2a:95:58:92:27:d2:98:73:f0:2d:61:3f
. 2010-11-04 12:22:19.376 Initialised triple-DES CBC client->server encryption
. 2010-11-04 12:22:19.376 Initialised HMAC-SHA1 client->server MAC algorithm
. 2010-11-04 12:22:19.376 Initialised triple-DES CBC server->client encryption
. 2010-11-04 12:22:19.376 Initialised HMAC-SHA1 server->client MAC algorithm
. 2010-11-04 12:22:19.579 Reading private key file "C:\TEST@ABC.ppk"
! 2010-11-04 12:22:19.579 Using username "rdi".
. 2010-11-04 12:22:19.689 Offered public key
. 2010-11-04 12:22:19.892 Offer of public key accepted
! 2010-11-04 12:22:19.892 Authenticating with public key "rsa-key-20100924"
. 2010-11-04 12:22:20.345 Access granted
. 2010-11-04 12:22:20.454 Opened channel for session
. 2010-11-04 12:22:20.783 Started a shell/command
. 2010-11-04 12:22:20.783 --------------------------------------------------------------------------
. 2010-11-04 12:22:20.783 Using SFTP protocol.
. 2010-11-04 12:22:20.783 Doing startup conversation with host.
> 2010-11-04 12:22:20.783 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2010-11-04 12:22:21.126 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2010-11-04 12:22:21.126 SFTP version 3 negotiated.
. 2010-11-04 12:22:21.126 We believe the server has signed timestamps bug
. 2010-11-04 12:22:21.126 We will use UTF-8 strings for status messages only
. 2010-11-04 12:22:21.126 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2010-11-04 12:22:21.126 Changing directory to "/rdi.toabc".
. 2010-11-04 12:22:21.126 Getting real path for '/rdi.toabc'
> 2010-11-04 12:22:21.126 Type: SSH_FXP_REALPATH, Size: 33, Number: 16
< 2010-11-04 12:22:21.189 Type: SSH_FXP_NAME, Size: 69, Number: 16
. 2010-11-04 12:22:21.189 Real path is '/rdi.toabc'
. 2010-11-04 12:22:21.189 Trying to open directory "/rdi.toabc".
> 2010-11-04 12:22:21.189 Type: SSH_FXP_LSTAT, Size: 33, Number: 263
< 2010-11-04 12:22:21.267 Type: SSH_FXP_ATTRS, Size: 37, Number: 263
. 2010-11-04 12:22:21.267 Getting current directory name.
. 2010-11-04 12:22:21.267 Startup conversation with host finished.
< 2010-11-04 12:22:21.283 Script: Active session: [1] ABC
> 2010-11-04 12:22:21.283 Script: open sftp://rdi@mmmm.abc.com -privatekey=C:\TEST@ABC.ppk
. 2010-11-04 12:22:21.283 --------------------------------------------------------------------------
. 2010-11-04 12:22:21.283 WinSCP Version 4.2.8 (Build 818) (OS 5.2.3790 Service Pack 2)
. 2010-11-04 12:22:21.283 Login time: Thursday, November 04, 2010 12:22:21 PM
. 2010-11-04 12:22:21.283 --------------------------------------------------------------------------
. 2010-11-04 12:22:21.283 Session name: rdi@mmmm.abc.com
. 2010-11-04 12:22:21.283 Host name: mmmm.abc.com (Port: 22)
. 2010-11-04 12:22:21.283 User name: rdi (Password: No, Key file: Yes)
. 2010-11-04 12:22:21.283 Tunnel: No
. 2010-11-04 12:22:21.283 Transfer Protocol: SFTP
. 2010-11-04 12:22:21.283 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2010-11-04 12:22:21.283 Proxy: none
. 2010-11-04 12:22:21.283 SSH protocol version: 2; Compression: No
. 2010-11-04 12:22:21.283 Bypass authentication: No
. 2010-11-04 12:22:21.283 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2010-11-04 12:22:21.283 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2010-11-04 12:22:21.283 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2010-11-04 12:22:21.283 SFTP Bugs: -,-
. 2010-11-04 12:22:21.283 Return code variable: Autodetect; Lookup user groups: Yes
. 2010-11-04 12:22:21.283 Shell: default
. 2010-11-04 12:22:21.283 EOL: 0, UTF: 2
. 2010-11-04 12:22:21.283 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2010-11-04 12:22:21.283 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2010-11-04 12:22:21.283 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-11-04 12:22:21.283 Cache directory changes: Yes, Permanent: Yes
. 2010-11-04 12:22:21.283 DST mode: 1
. 2010-11-04 12:22:21.283 --------------------------------------------------------------------------
< 2010-11-04 12:22:21.283 Script: Searching for host...
. 2010-11-04 12:22:21.283 Looking up host "mmmm.abc.com"
. 2010-11-04 12:22:21.283 Connecting to 12.9.150.100 port 22
< 2010-11-04 12:22:21.314 Script: Connecting to host...
. 2010-11-04 12:22:21.486 Server version: SSH-2.0-OpenSSH_4.3
. 2010-11-04 12:22:21.486 We believe remote version has SSH-2 ignore bug
. 2010-11-04 12:22:21.486 Using SSH protocol version 2
. 2010-11-04 12:22:21.486 We claim version: SSH-2.0-WinSCP_release_4.2.8
. 2010-11-04 12:22:21.533 Doing Diffie-Hellman group exchange
. 2010-11-04 12:22:21.798 Doing Diffie-Hellman key exchange with hash SHA-1
< 2010-11-04 12:22:21.970 Script: Authenticating...
. 2010-11-04 12:22:21.970 Host key fingerprint is:
. 2010-11-04 12:22:21.970 ssh-rsa 2048 e2:2c:8b:2e:2a:95:58:92:27:d2:98:73:f0:2d:61:3f
. 2010-11-04 12:22:21.970 Initialised AES-256 SDCTR client->server encryption
. 2010-11-04 12:22:21.970 Initialised HMAC-SHA1 client->server MAC algorithm
. 2010-11-04 12:22:21.970 Initialised AES-256 SDCTR server->client encryption
. 2010-11-04 12:22:21.970 Initialised HMAC-SHA1 server->client MAC algorithm
. 2010-11-04 12:22:22.220 Incoming packet was garbled on decryption
. 2010-11-04 12:22:22.236 Script: Failed
. 2010-11-04 12:22:22.236 Closing connection.
. 2010-11-04 12:22:22.236 Sending special code: 12
. 2010-11-04 12:22:22.236 Sent EOF message