none
Establish SSH within Control Flow using cygwin RRS feed

  • Question

  • I have a package that uses two connection managers. One requires that an SSH tunnel is opened via Cygwin.

    I currently have an execute process task that opens a cmd window and gives it the argument to open the ssh tunnel which it does successfully. The problem I am having is that I cannot get it to see the connection manager, once the SSH tunnel task is executed, is able to connect successfully.

    When I run the cmd to open the SSH tunnel manually then manually test the connection manager via right-click--> edit on the connection manager it succeeds in the test. I cannot, however, get it to do this within the flow itself without me manually doing something before hand.

    Things I've tried:

         Tried using a Script Task to acquire the connection (using C#) This returns an error of unable to   

         establish connection.

         Set 'Delay Validation' to True on the connection manager as well as the tasks that use this

         connection manager.

         Trying to figure out how to use a Script Task to add a new connection and acquire it in C# to the

         already existing package. I have yet to have any positive findings from my internet searches.

    What I am trying to do in the package:

         1. Establish the ssh tunnel using Cygwin (works)

         2. Connect to database using a connection manager that uses this newly created tunnel

            (does not work)

    Any help would be much appreciated. 


    Wednesday, October 9, 2019 7:22 PM

Answers

All replies

  • Hi CBoone55,

    Please refer to the following link:

    Connecting to Data Sources in the Script Task

    Best Regards,

    Mona


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, October 10, 2019 7:14 AM
  • I will take another look at that documentation. After looking at it this morning I think it may come down to a permissions issue. I'm spitballing but the tunnel is only usable by a specific user on the server but if I execute the package once deployed I know it is being run by SQL Server Agent.

    My experience with this is very minimal as our company has never done this before.

    I will try to pick apart that link a bit more and try some things. If it works by the end of the day I will be sure to mark as answered.

    Thank you!

    Thursday, October 10, 2019 12:52 PM
  • Mind that SSH tunneling is not ideal in terms of reliability plus it has a lot of potential for security breached.

    Arthur

    MyBlog


    Twitter

    Thursday, October 10, 2019 3:33 PM
    Moderator
  • You may also want to check the commercial COZYROC SSIS+ library. We provide a reusable script here which gives you ability to open an SSH secure tunnel.

    SSIS Tasks Components Scripts Services | http://wwww.cozyroc.com/

    Thursday, October 10, 2019 4:50 PM
  • I will mark this thread as answered. The revisiting the link provided by Mona got me searching for more in depth details ti my specific issue. I'm using C# to create a new connection in the already existing package. Opening the tunnel right before executing the script seems to be working. If anything changes I will be sure to update here.

    Thank you everyone for the quick responses!

    Thursday, October 10, 2019 8:29 PM