Skip to content

Instantly share code, notes, and snippets.

@AkdM

AkdM/bind_port_locally.md

Last active Mar 23, 2018
Embed
What would you like to do?
Bind port from SSH locally

If you want to bind the port 19999 (netdata default port for instance) to port 12345:

ssh -N -L 12345:localhost:19999 $SSH_USER@$SSH_IP -p $SSH_PORT

If you need to execute it in background, simply add the -f flag:

ssh -fN -L 12345:localhost:19999 $SSH_USER@$SSH_IP -p $SSH_PORT

then kill it with kill -9 $PID

(find the PID by typing ps aux | grep ssh

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