Robomongo: SSH support

Created on 13 Jun 2013  Â·  46Comments  Â·  Source: Studio3T/robomongo

Very cool project!

For security purposes, would be ideal if remote hosts could be accessed via ssh, where robomongo ssh-es to the desired server, then accesses 127.0.0.1:27017 to do the actual mongo access. (See HeidiSQL for example). This way, 27017 would not need to be open to the world on the server, data is encrypted in transit, and all user control is done in one place (ssh).

feature-request

Most helpful comment

@tylercollier The 0.8.5 has SSH support but does not work with MongoDB 3+. 0.9.X series work well with MongoDB 3+, but does not support SSH yet. The good news tho, is that SSH is our current priority and it will be out there in a few weeks for sure. Stay tuned! Use #1002 to track progress.

All 46 comments

Yes SSH or plink support would be fine.

At the moment I tunnel the connection via putty so i can connection setting leave untouched.

+1

+1

+1! SSH Tunneling Please!

BTW you can do a tunneling by yourself (terminal osx)

ssh -L 8080:127.0.0.1:27017 -f -C -q -N [email protected]

Put your password to connect and done.

In robomongo connect to localhost port 8080 (or whatever you want)

+1

The issue description mentions SSHing in and connection to localhost but ideally this would be robust so that (a) an SSH connection would be established and (b) the connection tab would be used to connect from within the SSH connection.

This would allow "psuedo-VPN" like activities where I can SSH into a server and connect to a database within that server network's. This is useful when one server (ssh) is accessible from public networks and another server (mongo) is within a private network/behind a firewall.

+1

+1

+1

+1

+1

+1

+1

@stmoroz please verify.

Verified. Connection via password authentication works. Connection via key works well if keys have been generated on the server side. I will close this issue. All enhancements and issues of this feature we will track as separate ticket.

i have a ssh tunnel by ssh -N -D,it no password and no user,how can i connect by it to my mongoDB server ?

@loveai88 -D is not an ssh tunnel (not the one you need). @glpunk gave an example of command you need: https://github.com/paralect/robomongo/issues/117#issuecomment-23499036

@ixti thanks for you replay.now i do like this ssh *** -p 22 -l guest -nN -L9292:172.19.104.104:27017, but u can't connect it by localhost:9292

@loveai88 can you connect to 172.19.104.104:27017 with mongo client from that SSH host? I mean can you log into that host: ssh *** -l guest and then mongo 172.19.104.104:27017 there?

@ixti i can log into the ssh server,and i can telnet 172.19.104.104 27017 in the server,the server i don't install mongodb client,is this has a question?

@loveai88 OK. Can you try to connect via SSH tunnel using console mongo client on you local machine?

@ixti yes ,i can ,i can connect the remote mongodb by mongo localhost:27031

@loveai88 now i lost what is your issue then?.. if you can connect with mongo localhost:27031 then you can connect to it with robomongo...

@ixti
image

look,i config the ssh tunnel in robomongo like this,and it show me this message.
and ,the ssh will show the verbose like this
image

@ixti if i connect the remote mongodb use client like mongo localhost:27031,it only show me like this
image

not free direct-tcpip if i not disconnect

Looks like issue is related to another open defect - https://github.com/paralect/robomongo/issues/484

basically robomongo client doesn't work properly with SSH yet

+1 to using putty tunneling, since nobody from robomongo seem to want to respond.
Here is a detailed guide on another free good client which explains how to do putty tunelling: http://www.mongovue.com/2011/08/04/mongovue-connection-to-remote-server-over-ssh/

this only works for if mongo is on the server you are ssh into:

ssh -L 27017:localhost:27017 proxy-instance

Neither does it work if we need to access another server from the ssh tunneling proxy

ssh -L 27017:mongo-instance:27017 proxy-instance

Nor does it work if we need to ssh hopping:

Host mongo-instance
    ProxyCommand ssh -q proxy-instance nc -q0 %h 22

So when there is policy that mongo-instance ssh is not enable externally, you can do nothing.

I suggest:
1) use the ssh/config by default
2) the ssh proxy can forward request to arbitary host (e.g. -L 27017:WANTED-HOST:27017)

Please give a step wise procedure for making a connection using SSH tunnel between ubuntu and windows

Another Windows client -> Ubuntu server issue here! SSH would be nice between the two.

+1 swami123

+1 for Windows -> Unix SSH help

Thank you glpunk for your comment on Aug 29, 2013 - worked like a charm!

Quote:

BTW you can do a tunneling by yourself (terminal osx)

ssh -L 8080:127.0.0.1:27017 -f -C -q -N [email protected]

Put your password to connect and done.

In robomongo connect to localhost port 8080 (or whatever you want)

thanks i will try and let you know

On Fri, Apr 24, 2015 at 1:19 AM, stenio123 [email protected] wrote:

Thank you glpunk https://github.com/glpunk for your comment on Aug 29,
2013 - worked like a charm!

Quote:

BTW you can do a tunneling by yourself (terminal osx)

ssh -L 8080:127.0.0.1:27017 -f -C -q -N [email protected]

Put your password to connect and done.

In robomongo connect to localhost port 8080 (or whatever you want)

—
Reply to this email directly or view it on GitHub
https://github.com/paralect/robomongo/issues/117#issuecomment-95697373.

FYI, the plan to allow SSH seems to have been dropped. Version 0.9.0-RC5 on my Mac doesn't even have an SSH tab in the connection setup.

I'm able to get it to work with version 0.9.0-RC5 on my mac when I set up an external SSH tunnel, but the same thing doesn't work for me using 0.8.5 on Ubuntu 14.04. It will show me databases, but not collections. Nothing shows up in the logs so I can't diagnose.

@tylercollier The 0.8.5 has SSH support but does not work with MongoDB 3+. 0.9.X series work well with MongoDB 3+, but does not support SSH yet. The good news tho, is that SSH is our current priority and it will be out there in a few weeks for sure. Stay tuned! Use #1002 to track progress.

@anorsich Oops, I apologize for putting out misinformation then. Thank you for the update and link to #1002!

@tylercollier No worries, your comment was absolutely correct. An external tunnel is the only way to connect to MongoDB in a private cluster using 0.9.X Robomongo.

Using obomongo 0.9.0-RC8 on macosx ver 10.10.5 :
I have jumphost to go to production server of mongodb. I configure in SSH tunnel -> the details about jumphost (server->jumphost02.internal.company.com) and in connection -> production server name (mongodbproduction.internal.company.com:) and port 27017. But am getting error

Cannot establish SSH tunnel (jumphost02.internal.company.com:22).
Error:
Operation timed out. Failed to create SSH channel. (Error #60)

On diagnostic window - 3 lines show as :
connected to ssh server at jumphost02.internal.company.com - Pass -> green
failed to connect to mongodbproduction.internal.company.com:27017 via tunnel - Failed
No chance to authorise

Hi @bbabu12, could you please specify the OS versions of your servers? (jumphost02 and mongodbproduction)

@bbabu12, I just tested with SSH server (Ubuntu 16.04) and mongodb server (MAC OS X 10.11.3), it worked.

My mongodb and jumphost servers are LINUX centos 6.3

On May 24, 2016, at 6:47 AM, simsekgokhan [email protected] wrote:

@bbabu12, I just tested with SSH server (Ubuntu 16.04) and mongodb server (MAC OS X 10.11.3), it worked.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Did you tested on a server behind the firewall ?
So you connect to launch/jumphost and connect to mongodb server?

Your laptop ->jumphost server->mongodb server

On May 24, 2016, at 6:47 AM, simsekgokhan [email protected] wrote:

@bbabu12, I just tested with SSH server (Ubuntu 16.04) and mongodb server (MAC OS X 10.11.3), it worked.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Hi @bbabu12 , we have also reproduced the issue (without firewall), we are investigating the logs now. Best Regards.

Hello. @simsekgokhan, is there already a way to establish the SSH connection via a jumphost?
For example, it is possible to use or mimic the OpenSSH "config" file? More specifically, I need to do it in Windows environment (i. e. manually select the config file or jumphost settings).
Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juliashibalko picture juliashibalko  Â·  3Comments

andidev picture andidev  Â·  3Comments

OmisNomis picture OmisNomis  Â·  3Comments

kphamilton picture kphamilton  Â·  3Comments

rspeed picture rspeed  Â·  4Comments