Connecting to remote server application when you do not have direct access to the remote server

Most of the IT Infrastructures are using Virtualization Solutions in their environment to optimally utilize the Infrastructure resource such as Server, Network and etc..


Providing corporate network IP for each Virtual Servers are not a best solution as there will be several servers in the organization and most of the systems need not to be configured with such IP addresses as the systems are not frequently accessed from corporate network.


Use cases:
  1. We may have to access the application running in a server, which do not have corporate network IP, thus our system cannot access the application server IP address directly
  2. We can choose to minimize the corporate network IP by just allocating a corporate network IP for a particular server, which we further call as JUMP Server

If we have to login to a server which is in private network, one can login directly from his laptop/workstation connected in the corporate network to JUMP Server. 
From the Jump server, can choose to make ssh connection to the private network server.

The above method works good for SSH, but what if a web service running in the private network server needs to be accessed directly from web browser of a user laptop/workstation. Here is where the port forwarding is needed in order to achieve the requirement


Let's consider this example:

Private network server IP: 25.52.108.12
Private network server Port: 8443 - The port used by the web service
Jump Server IP: 192.168.1.2
Jump Server Username: centos


Run the following command in your laptop / workstation to enable the port forwarding:
You will be prompted for Jump Server password to enable the connection.

# ssh -L 8443:25.52.108.12:8443 centos@192.168.1.2
8443 following by -L, Port of your laptop / workstation.

Since 8443 port of your system is used for the port forwarding, after executing the above command, now you will be able to access the web application running in the private network server through your web browser via URL: https://localhost:8443


Note: The ssh command works good in all Operating system platforms. Some operating system may not have the command installed by default, in those cases you can download and install SSH software.

Post a Comment

0 Comments