No announcement yet.

SSH port Forwarding


Unconfigured Ad Widget

  • Filter
  • Time
  • Show
Clear All
new posts

  • SSH port Forwarding

    Can anyone tell me is it possible to set port forwarding for a remote server? If yes, how can I set port forwarding for a remote server?

  • #2
    SSH port forwarding, also referred to as SSH tunneling, is the process of establishing a secure and encrypted SSH connection between a client and a server machine. This connection allows for the relay of service ports, enabling the secure forwarding of network traffic between the two machines.

    SSH forwarding is valuable in transporting network data for services that rely on unencrypted protocols like VNC or FTP. It offers a secure method to transmit this data by leveraging the encryption provided by SSH. Additionally, SSH forwarding facilitates accessing geo-restricted content and bypassing intermediate firewalls that might restrict the direct access to certain services.

    SSH port forwarding comprises three distinct types:

    1) Local Port Forwarding is a method of SSH port forwarding that enables you to establish a connection from your client to the SSH server and then forward that connection to a specific destination host port.

    2) Remote Port Forwarding is a type of SSH port forwarding that facilitates forwarding a port from the server to the client and then to a specific destination host port.

    3) Dynamic Port Forwarding is a type of SSH port forwarding that establishes a SOCKS proxy server, enabling communication across a range of ports.

    To set port forwarding for the remote server, you can specify remote SSH port forwardings using the -R option. This option allows you to define the forwarding rules for remote ports. Here is the basic syntax:


    The options used are as follows:

    REMOTE_PORT - the port number and IP address on the remote SSH server. If the REMOTE value is not specified, then the remote SSH server will bind to all interfaces.

    DESTINATION_PORT - Specifies the IP address or hostname and the port number of the destination machine.

    [USER@]SERVER_IP - Specifies the remote SSH user and the server's IP address.

    Remote port forwarding is used to grant external individuals access to an internal service.

    For example, ssh -R [email protected]

    By specifying the -R flag, we establish that requests sent to the remote server port 9090 will be redirected to, which resides on the local network at port 80. If we initiate a request to the server using port 9090, we will receive a response from