QuickTip – Connecting database client directly on server, without open doors

In this QuickTip I’ll show you how to connect your database client directly on server, without open doors. This trick is nice because you can open a ssh tunnel between your machine and any server, connect on localhost and see the remote data, this is useful specially if you don’t want to use terminal. If you execute this script, a tunnel will be closed between your machine and the other one “change ” </em></span>_ _after that, you just need to connect on **localhost:3333**

#!/bin/bash
var=3333
if test $1 <> null
then
var=$1
fi
ssh -L $var:localhost:27017 -l <USER ON SERVER> <SERVER IP>

In this gif, I’m connection on localhost:3333 but accessing a database on a remote server. If you want to see better, just click over the image. Just it, you have the same benefit of leaving the door open, but safely.

Allan de Queiroz

Allan de Queiroz
London based software engineer

XServer forward from Linux text mode for Headless purposes.

Hello, this post is about XServer forward from Linux text mode, **not ssh forward, anything related to VNC** or things like that.Recently...… Continue reading