How to do port forwarding with SSH

Table of contents

Simple Port Forwarding

Assuming the web server has a web service running on port 54242, the following command forwards traffic from the remote server's port 54242 to the local port 55000.

sh -L 55000:localhost:54242 user@

While more complex setups involving firewalls or VPNs are available, for straightforward scenarios like exposing a service accessible only at home to the university, this method should suffice.

Related Content
I’m a passionate full-stack software engineer, architect and Debian lover.