Skip to content

Instantly share code, notes, and snippets.

@redrush85
Created April 4, 2019 09:35
Show Gist options
  • Save redrush85/ca67805534a9a2633531eb6c71335545 to your computer and use it in GitHub Desktop.
Save redrush85/ca67805534a9a2633531eb6c71335545 to your computer and use it in GitHub Desktop.

Create SSH Tunnel

ssh -L 8888:127.0.0.1:27017 [email protected]

enter your ssh password, if success you will see ssh welcome message.

Connect with mongo client

mongo 127.0.0.1:8888/

Dump database

mongodump --host=127.0.0.1 --port=8888 --db=database_name

Logout SSH Tunnel

List connection

~#

Close connection

~&

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment