I am using a bastion host(jump server) to connect to MongoDB. I can use it via command line but I am looking to connect via Compass client.

My scenario is I have an ec2-A(public) instance which uses ec2-B(private)instance to MongoDB. I know how to do it on Windows via putty but how to do it on a Mac??

Using this to connect jump server

ssh -i ~/B.pem -o "ProxyCommand ssh -W %h:%p -i ~/A.pem ubuntu@ec2-xx-xx-xx-xxx.eu-west-2.compute.amazonaws.com" ubuntu@1xx.xx.48.xx

and then mongo connection command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.