I've successfully created a SSH tunnel to our cloud postgresql server on a local linux server, with this command:
ssh -N -f -L 5431:localhost:xxxx mycloudserver.com
(where xxxx is remote port)
With this command I can access remote PostgreSQL database through port 5431, but only on this linux server.
Now I want to "share" this connection with other PCs on the network so that I can connect to linux_server:5431 with an ODBC driver and read the cloud database, without installing any SSH software on the clients. Opening port 5431 with iptables didn't work.
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 192.168.128.5 --dport 5431 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s 192.168.128.5 --sport 5431 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
Already tried
ssh -N -f -L 5431:0.0.0.0:xxxx mycloudserver.com
too. The tunnel is successfully built and works on the server, but I can't "see" the connection from the clients.