•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

SSH Port Forwarding

  • Home
  • Client
  • Qa Forum
  • SSH Port Forwarding

Posted By: Joe | 1 Replies | Last Reply On: Oct 31, 2017 16:26:21

How does SSH port forwarding works and how can i set it up on Centos 7? 

Psychz - Amol

Votes: 0Posted On: Oct 31, 2017 16:26:21
 

Port forwarding is the process of sending data, connections or requests of a local port to remote ports via an alternate medium. We are able to achieve this through SSH, also known as SSH port forwarding.

Under the process of SSH port forwarding, the various programs running on the local machine can connect to the remote server via the SSH connection. This is done to bypass the firewall of the remote server. For instance, SSH port forwarding can be used to access websites that are blocked by the firewall.

There are primarily three types of port forwarding. These are mentioned in detail below.


Local Port Forwarding

It is the most common type of port forwarding. In this type, the connections from one machine are forwarded through the SSH connection to the remote server. If a program or application is trying to connect to a remote server but is blocked by the firewall, it can establish connections through SSH. For instance, you can connect to a website through SSH by entering the source and destination port with website's name and host ID.

This is the command that can be used for such an instance.

 

ssh -L 8080:www.abc.com:80 user@remote IP address

- The "-L" option is used for Local Port Forwarding.
- 8080 is the HTTP port at the localhost.
- www.abc.com is the website you are trying to connect.
- 80 is the remote HTTP port.


Remote Port Forwarding

Remote port forwarding is a less common type of port forwarding. This is because it implies that the remote server tries to access programs of the local machine through SSH. In this type, the connections from the remote SSH server are forwarded via the SSH client, then to a local machine.

You can use the Remote Port Forwarding with the help of the following command.

 

ssh -R 5900:localhost:5900 user@destination IP address.

- The "-R" option is used for remote port forwarding
- 5900 is the default VNC port.


Dynamic Port Forwarding

It is rather the least used type of SSH port forwarding. In dynamic port forwarding, we make use of SOCKS proxy server. SOCKS is a little-known but widely-implemented protocol for programs to request any Internet connection through a proxy server. 

With dynamic port forwarding, you can access all the ports of the remote machine. Hence, this type of port forwarding is not recommended and rarely used.

Please use the following command for dynamic port forwarding.

 

ssh -C -D 1080 username

Was this reply helpful?

Related topics

  • SSH Agent Forwarding
  • How to generate SSH Keys on Linux?
  • How to remotely connect to a Linux machine using a smartphone?
  • Unable to Access The Server Via SSH
  • SSH Reverse Tunnel
  • SSH File Transfer
  • SSH Connection refused
  • SSH Keys - Create
  • Firewalld commands for CentOS 7 and CentOS 8
  • Start SSH server?
  • How To Setup Application Load Balancer Using CDN
  • Theft of Cryptocurrency of MyEtherWallet users by BGP Hijack
  • CDN and Load Balancer: Ultimate combination for efficient content delivery
  • Why Gaming Companies are Choosing Bare Metal Servers
  • In Comparison: FreeBSD VS Linux
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801