SSH Tunnel works, but connection to mongodb not

Samuel Suther shared this idea 9 months ago
Completed

noSQLBooster 6.2

Linux

I've seen some other posts here in the forum, but couldn't find a solution after trying for hours now.


Here is the issue:

I've created a ssh-login for user `deploy`.

I can login via ssh with this user, and I can access mongo with this user via ssh-cli


The mongo.conf has this:

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1
Server is up and running.


Next I've tried to connect via SSH-Tunnel to this server. SSH-Connection is established, but the connection to the mongo db not:


8a6d36e726e8a63fbb960979f1911668


Why does "Connect to localhost" is the first failure. Might it be, that the noSQLBooster try to connect to via the mapped tunnel-ip on localhost, BEFORE the tunnel is established?


BTW: If I change bindIP to the official Server-IP-Address, and login without ssh-tunnel connection it work like expected. But I need to access mongo via SSH-Tunnel for security purposes.

Replies (1)

photo
1

I've fixed it.

The issue was, that I need to set "AllowTcpForwarding yes` in `/etc/ssh/sshd_conf` at the server.

Then it works like expected.

Leave a Comment
 
Attach a file