•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Backup
    • Content Delivery Network
    • Colocation Hosting
    • Dedicated Hosting
    • DDoS Mitigation
    • IP Transit
    • Private Cloud
    • Wavelength
  •  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
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDos Protection
    • IP Transit
    • CDN
    • Backup
  • 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 remotely connect to a Linux machine using a smartphone?
  • Unable to Access The Server Via SSH
  • SSH Reverse Tunnel
  • SSH File Transfer
  • Firewalld commands for CentOS 7 and CentOS 8
  • SSH Connection refused
  • SSH into Docker Container
  • How To Secure cPanel?
  • ssh host key verification failed error
  • 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
  • GitHub survives world's largest DDoS attack
Hosting Services
  • Dedicated Hosting
  • Colocation Hosting
  • Backup
  • IP Transit
  • DDoS Mitigation
Support
  • Portal Login
  • Knowledgebase
  • Community
Company
  • About Us
  • Contact Us
  • Network
  • Data Centers
  • Looking Glass
  • Affiliates
  • Reseller
  • Blog
Policies
  • Privacy Policy
  • Acceptable Usage Policy
  • Terms and Conditions
  • Service Level Agreement
Company
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801
Subscribe to Our Mailing List
* indicates required
Copyright © 2023 Psychz Networks, A Profuse Solutions Inc Company