SSH port Forwarding

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Clay Page
    Member
    • Sep 2022
    • 82

    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?
  • Annie_P
    Member
    • Aug 2022
    • 86

    #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:

    ssh -R [REMOTE:]REMOTE_PORT: DESTINATIONESTINATION_PORT [USER@]SSH_SERVER

    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 9090:example.com:80 admin@server.com

    By specifying the -R flag, we establish that requests sent to the remote server port 9090 will be redirected to example.com, 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 example.com.

    Comment

    Working...
    X