# How To Do Port Forwarding Using SSH - Used By Professionals

**URL:** <https://onehack.st/t/how-to-do-port-forwarding-using-ssh-used-by-professionals/88583>\
**Category:** Tutorials & Methods\
**Tags:** networking\
**Created:** [May 27, 2020, 1:35pm UTC](https://onehack.st/t/how-to-do-port-forwarding-using-ssh-used-by-professionals/88583 "2020-05-27T13:35:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheStrength](https://onehack.st/user_avatar/onehack.st/thestrength/32/46753_2.png) [@TheStrength](https://onehack.st/u/TheStrength)\
**Post date:** [May 27, 2020, 1:35pm UTC](https://onehack.st/t/how-to-do-port-forwarding-using-ssh-used-by-professionals/88583/1 "2020-05-27T13:35:07Z")

</div>

As we all know the role of port forwarding is most important in the field of **ethical hacking** and pen testing to deal with wide area network devices. So today I’m going to show you the best and genuine way used by **professionals** to do **port forwarding**.

### Requirements:-

- SSH
- Apache2

We are going to use **SSH** (Secure Shell ) portocoal network service to do port forwarding as we know it’s used for remote login into machines and here we going to show you two different methods to do port forwarding using ssh.

1. Simple Port Forwarding

2. Port Forwarding With Subdomain

### Simple Port Forwarding:-

In this method we are going to use serveo server with ssh.

$ sudo service apache2 start

$ ssh -P port:Your-IP-Address:port [serveo.net](http://serveo.net)

 ![image](https://onehack.st/uploads/default/original/3X/9/f/9f6244efd8db70066cee125be6acb0003e0e3b8a.jpeg)

### Port Forwarding With Subdomain:-

In this method we are going to use subdomain with localhost.

$ sudo service apache2 start

$ ssh -P port:Your-IP-Address:port ssh.subdomain.localhost.run

 ![image](https://onehack.st/uploads/default/original/3X/a/0/a02b9af57f3669d8a2957fe945ea7fb02337ab59.jpeg)

I hope this information is helpful for you, thanks for reading!

_(Source: hackersking)_
