Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: same problem

derrickatadams wrote:

when run in debug mode in .net , works flawlessly.

when deployed into sql server as dtsx , i get an error same as original post.

See https://winscp.net/eng/docs/scripting#hostkey
derrickatadams

same problem

when run in debug mode in .net , works flawlessly.

when deployed into sql server as dtsx , i get an error same as original post.

winscp script
open user:pw@sftp.pls.com
get /20190204/myfileru.ftp C:\Users\Public\Downloads
close
exit


i implemented the log and got this
. 2019-02-05 17:04:53.639 We claim version: SSH-2.0-WinSCP_release_5.13.7
. 2019-02-05 17:04:53.676 Server version: SSH-2.0-SSHD
. 2019-02-05 17:04:53.676 Using SSH protocol version 2
. 2019-02-05 17:04:53.677 Doing Diffie-Hellman group exchange
. 2019-02-05 17:04:53.930 Doing Diffie-Hellman key exchange with hash SHA-256
. 2019-02-05 17:04:55.080 Host key fingerprint is:
. 2019-02-05 17:04:55.080 ssh-rsa 2048 dd:6d:71
f:c5:2e:cc:c:f8 KSwYsc5594wsQXywACeEnE7BNjRQ6
. 2019-02-05 17:04:55.080 Asking user:
. 2019-02-05 17:04:55.080 **Continue connecting to an unknown server and add its host key to a cache?**
. 2019-02-05 17:04:55.080
. 2019-02-05 17:04:55.080 The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is.
. 2019-02-05 17:04:55.080
. 2019-02-05 17:04:55.080 The server's RSA key details are:
. 2019-02-05 17:04:55.080
. 2019-02-05 17:04:55.080     Algorithm:   ssh-rsa 2
. 2019-02-05 17:04:55.081     SHA-256:   KSwYscd559ywdddACeEnE7BNjR=
. 2019-02-05 17:04:55.081     MD5:   dd:6d:71:ff:c5:2e:cc:
. 2019-02-05 17:04:55.081
. 2019-02-05 17:04:55.081 If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
. 2019-02-05 17:04:55.081 In scripting, you should use a -hostkey switch to configure the expected host key. ()
. 2019-02-05 17:05:05.082 Attempt to close connection due to fatal exception:
* 2019-02-05 17:05:05.082 Host key fingerprint is ssh-rsa 204 SwYsdc5594wsQXywACeEnfE7BNjRQ
* 2019-02-05 17:05:05.082 (Exception) **Host key wasn't verified!**

Help please
martin

dndaughtery wrote:

BTW, we are able to connect using filezilla using that user and password

Are you sure you use SFTP, and not FTP (or FTPS) with FileZilla?
Show us a FileZilla log file (a real log file, not a message log from the GUI).
dndaughtery

BTW, we are able to connect using filezilla using that user and password
Dan2

> 2016-02-23 09:24:11.640 Script: option confirm off
< 2016-02-23 09:24:11.640 Script: confirm         off       
> 2016-02-23 09:24:11.640 Script: open sftp://MyUsername:***@MySFTP.Server.com:22
. 2016-02-23 09:24:11.640 --------------------------------------------------------------------------
. 2016-02-23 09:24:11.640 Session name: MyUsername@MySFTP.Server.com (Ad-Hoc site)
. 2016-02-23 09:24:11.640 Host name: MySFTP.Server.com (Port: 22)
. 2016-02-23 09:24:11.640 User name: MyUsername (Password: Yes, Key file: No)
. 2016-02-23 09:24:11.640 Tunnel: No
. 2016-02-23 09:24:11.640 Transfer Protocol: SFTP
. 2016-02-23 09:24:11.640 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2016-02-23 09:24:11.640 Disable Nagle: No
. 2016-02-23 09:24:11.640 Proxy: none
. 2016-02-23 09:24:11.640 Send buffer: 262144
. 2016-02-23 09:24:11.640 SSH protocol version: 2; Compression: No
. 2016-02-23 09:24:11.640 Bypass authentication: No
. 2016-02-23 09:24:11.640 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2016-02-23 09:24:11.640 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2016-02-23 09:24:11.640 KEX: dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,rsa,WARN
. 2016-02-23 09:24:11.640 SSH Bugs: A,A,A,A,A,A,A,A,A,A,A,A
. 2016-02-23 09:24:11.640 Simple channel: Yes
. 2016-02-23 09:24:11.640 Return code variable: Autodetect; Lookup user groups: A
. 2016-02-23 09:24:11.640 Shell: default
. 2016-02-23 09:24:11.640 EOL: 0, UTF: 2
. 2016-02-23 09:24:11.640 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2016-02-23 09:24:11.640 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2016-02-23 09:24:11.640 SFTP Bugs: A,A
. 2016-02-23 09:24:11.640 SFTP Server: default
. 2016-02-23 09:24:11.640 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-02-23 09:24:11.640 Cache directory changes: Yes, Permanent: Yes
. 2016-02-23 09:24:11.640 DST mode: 1
. 2016-02-23 09:24:11.640 --------------------------------------------------------------------------
. 2016-02-23 09:24:11.640 Looking up host "MySFTP.Server.com"
. 2016-02-23 09:24:11.703 Connecting to 555.555.555.555 port 22
. 2016-02-23 09:24:11.781 Server version: SSH-2.0-XFB.Gateway Unix
. 2016-02-23 09:24:11.781 Using SSH protocol version 2
. 2016-02-23 09:24:11.781 We claim version: SSH-2.0-WinSCP_release_5.7.6
. 2016-02-23 09:24:11.812 Using Diffie-Hellman with standard group "group1"
. 2016-02-23 09:24:11.812 Doing Diffie-Hellman key exchange with hash SHA-1
. 2016-02-23 09:24:12.654 Verifying host key rsa2 0x10001,0xc67021649eb498a4 8afe3f2c9d2fbf50 5b27bcb455e57200 bfdcd76d81c8bafe f76203726f7c2443 de684000316b2aca e271cad639ed6707 f2b1ec16edf7b822 a39a5499e13abbdb 3886059910bd9659 d31e009512f80ee2 3918ddf0bceb5381 81148f9185176a8b 79dda18f5e349838 3c5c47fadd0d4aa8 b6930cee529b8777  with fingerprint ssh-rsa 1024 4c:7d:06:34:f0:56:b2:7b:ad:5b:25:48:4d:91:85:36
. 2016-02-23 09:24:12.654 Host key matches cached key
. 2016-02-23 09:24:12.654 Host key fingerprint is:
. 2016-02-23 09:24:12.654 ssh-rsa 1024 4c:7d:06:34:f0:56:b2:7b:ad:5b:25:48:4d:91:85:36
. 2016-02-23 09:24:12.654 Initialised AES-256 SDCTR client->server encryption
. 2016-02-23 09:24:12.654 Initialised HMAC-SHA1 client->server MAC algorithm
. 2016-02-23 09:24:12.654 Initialised AES-256 SDCTR server->client encryption
. 2016-02-23 09:24:12.654 Initialised HMAC-SHA1 server->client MAC algorithm
! 2016-02-23 09:24:12.717 Using username "MyUsername".
. 2016-02-23 09:24:12.898 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2016-02-23 09:24:12.898 Using stored password.
. 2016-02-23 09:24:12.898 Sent password
. 2016-02-23 09:24:13.616 Received disconnect message (host not allowed to connect)
. 2016-02-23 09:24:13.616 Disconnection message text: ssh disconnect host not allowed to connect
. 2016-02-23 09:24:13.616 Server sent disconnect message
. 2016-02-23 09:24:13.616 type 1 (host not allowed to connect):
. 2016-02-23 09:24:13.616 "ssh disconnect host not allowed to connect"
dotps1

Re: Error when executing WinSCP from SSIS Execute Process task

a quick look to me and you have double quotes in your args as well as a space after WinSCP.exe, I would remove the quotes from Arguments: "/script=C:\SFTP.txt" and the trailing space so your actual cmdline looks like this:
"C:\Program Files (x86)\WinSCP\WinSCP.exe" "/script=C:\SFTP.txt"
rather then
"C:\Program Files (x86)\WinSCP\WinSCP.exe " ""/script=C:\SFTP.txt""
DNDAUGHTERY

Error when executing WinSCP from SSIS Execute Process task

Hey guys, I'm getting the following error when I try to run my package which contsins only an execute process task calling WinSCP.

Error: [Execute Process Task] Error: In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe " ""/script=C:\SFTP.txt"" at "C:\Program Files (x86)\WinSCP", The process exit code was "1" while the expected was "0".

Process task settings:
Executable: C:\Program Files (x86)\WinSCP\WinSCP.exe
Arguments: "/script=C:\SFTP.txt"
Working Directory: C:\Program Files (x86)\WinSCP
rest are default values

SFTP.txt code is as follows:
option batch on
option confirm off
open sftp://User:Password@My.Server.com:22
cd /foldername/foldername/foldername/foldername
option transfer binary
get *.csv \\Servername\foldername\foldername\foldername\foldername\
close
exit

Any ideas where I'm making my mistake?