Scripting using saved Session only uses Port 22, not saved port

Advertisement

Port_Madness
Guest

Scripting using saved Session only uses Port 22, not saved port

So I'm using SSIS to kick off the WinSCP.exe process.
We are blocking port 22 on our firewall.

We created a site and saved it via the WinSCP GUI. The site connects to this other port 4444 in the GUI perfectly. No issues with the software GUI.
However, when the script runs via Microsoft SSIS, it uses the saved site but keeps trying to connect to port 22 instead of port 4444. The log shows it is trying to connect to PORT 22 instead of the saved site port.

When I go to generate the URL/Script, it shows the port 4444. I used that generated URL script in my script file and the connection works fine. The problem only shows up when I try to use a saved site.

I'm attaching the log, script that runs, and also a pic of the site GUI.
Any ideas how to get the scripting to connect to the saved site port 4444 instead of the default port 22?

Thanks.

Description: GUI of site

WinSCP Site.png

Description: script that we run
Description: log that shows it's trying to knock on port 22 instead of port 4444

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Scripting using saved Session only uses Port 22, not saved port

Your SSIS script is not using your stored site at all.
. 2022-08-05 11:51:10.872 Local account: TESTING\svc_LP_D_DB
...
. 2022-08-05 11:51:10.887 Session name: dev-outbounddestination@sftp.testlocation.com (Ad-Hoc site)
Most likely because you have stored the site under a different local account.
See My script works fine when executed manually, but fails or hangs when run by Windows Scheduler, SSIS or other automation service. What am I doing wrong?
Moreover we do not recommend to rely on stored sites. Specifically to avoid problems like this.
See https://winscp.net/eng/docs/scripting#different_account

Reply with quote

Port_Madness
Guest

Thanks, really appreciate the answer!

Thank you for the quick response Martin!
We will use the generated URL configuration instead of using saved sites per your recommendation and FAQ docs.

Reply with quote

Advertisement

You can post new topics in this forum