Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1613

connection to mongodb with ssh using c# driver

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker - P1
    • Resolution: Duplicate
    • Affects Version/s: 2.2.3
    • Fix Version/s: None
    • Component/s: Connectivity
    • Labels:
      None
    • Environment:
      Windows application running in .net against mongodb env on aws hosted in linux

      Description

      how can we connect with ssh to mongodb server which located in aws and hosted in Linux server.
      we are getting a timeout when trying to connect to the mongo client.
      we are working in .net application using c# driver and trying to connect via ssh client.
      the following is snippet from our code:
      using (var client = new SshClient("<ip of aws machine>", 22, "mongodb user", "password"))

      { client.Connect(); var connectionString = "mongodb://root:passwordOfMongoDB@localhost:27017"; MongoClient MongoClient = new MongoClient(connectionString); IAsyncCursor<BsonDocument> lst11 = MongoClient.ListDatabases(); client.Disconnect(); }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              avi74 avi inbar
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: