VMWare vSphere 6.0 web client via SSH tunnel
Hi,
I just found a way to connect to a remote vCenter server via SSH tunnel, using the web client. This has been tested on vSphere 6.0, it may need some modifications to work on other version.
Let's define some information for this example:
The first thing to do is to execute this shell command to open an SSH connection and create tunnels:
sudo ssh -i /home/localuser/.ssh/id_rsa -l remoteuser1 -L 443:192.168.x.x:443 -L 902:192.168.x.x:902 -L 903:192.168.x.x:903 -L 9443:192.168.x.x:9443 -p 5252 x.x.x.x
Please not that we must use sudo because we're using ports =< 1024. Also note the -i, specifying the path to my private key. You won't need that if you're using password authentication.
The next step is to open a browser at https://localhost/vsphere-client/.
You'll see that you'll be redirected to an URL that is not using localhost as the hostname. It will use the FQDN of your vCenter server. What you need to do then is to set add this hostname to the 127.0.0.1 entry in your /etc/hosts file.
The final step is to restart your browser and access https://localhost/vsphere-client/ and it should work, including the remote console (please note that Adobe Flash is required, and maybe the Client Integration Plugin.
Once you're done, I suggest that you undo your change to your /etc/hosts file to avoid any problem or confusion in the future.
I just found a way to connect to a remote vCenter server via SSH tunnel, using the web client. This has been tested on vSphere 6.0, it may need some modifications to work on other version.
Let's define some information for this example:
- 192.168.x.x will be the IP address of the vSphere web client (vCenter)
- x.x.x.x will be the IP address of the SSH server
- localuser is the name of the user on the local machine (from which you execute the SSH command)
- remoteuser is the name of the username on the (remote) SSH server
- 5252 is the port on which the (remote) SSH server is listening
The first thing to do is to execute this shell command to open an SSH connection and create tunnels:
sudo ssh -i /home/localuser/.ssh/id_rsa -l remoteuser1 -L 443:192.168.x.x:443 -L 902:192.168.x.x:902 -L 903:192.168.x.x:903 -L 9443:192.168.x.x:9443 -p 5252 x.x.x.x
Please not that we must use sudo because we're using ports =< 1024. Also note the -i, specifying the path to my private key. You won't need that if you're using password authentication.
The next step is to open a browser at https://localhost/vsphere-client/.
You'll see that you'll be redirected to an URL that is not using localhost as the hostname. It will use the FQDN of your vCenter server. What you need to do then is to set add this hostname to the 127.0.0.1 entry in your /etc/hosts file.
The final step is to restart your browser and access https://localhost/vsphere-client/ and it should work, including the remote console (please note that Adobe Flash is required, and maybe the Client Integration Plugin.
Once you're done, I suggest that you undo your change to your /etc/hosts file to avoid any problem or confusion in the future.
Comments