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

connection to mongodb with ssh using c# driver

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker - P1 Blocker - P1
    • None
    • 2.2.3
    • Connectivity
    • None
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: