Reputation:
I'm trying to connect to a mongodb database remotely.
I have the following information:
I've already tried to connect from console but I fail.
Is there a way to connect from Compass while I forward the port?
Upvotes: 4
Views: 13389
Reputation: 523
When you want to connect to your instance from your workstation anywhere , ssh tunnelling is the way to go.
To use SSH Tunnel While creating a connection on MongoDB Compass , you need to choose it from the drop down box for the other text boxes to show up. Image for post The upcoming fields are pretty standard SSH information , nothing specific for MongoDB.
Upvotes: 9
Reputation: 557
If the port is open you can connect it with this command:
mongo --host ip -u user name -p password
Upvotes: -1