ufw and ssh tunnel

Pavol Travnik
Dec 13, 2020

You have two computers and you want to create connection to a specific port from one to another. Let’s have computer L(localhost) and R(remote server).

ssh -N -L <PORT>:127.0.0.1:<PORT> <R-USERNAME>@<R-IP-ADDRESS>

Obviously you are running this script from localhost and connecting to remote.

ufw rules are pretty simple then

sudo ufw allow in from <R-IP-ADDRESS> port <PORT>
sudo ufw allow out to <R-IP-ADDRESS> port <PORT>

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Pavol Travnik
Pavol Travnik

No responses yet

Write a response