Objectives
1. Use VMware vSphere Client to connect to a remote server
through an SSH tunnel.
Prerequisites
1. Remote connection to a terminal on the customer's
network.
2. VMware vSphere Client installed on your computer.
3. VPN connection.
4. root password for "fcadmin01.fullcount.net".
Instructions
Log
into the VPN.
Look
up the IP address of the physical server.
Log
into a FullCount terminal via SSH.
Note: The terminal must be able to ping the IP
address of the physical server.
Set an
environment variable with the IP address of the physical server:
# export SERVER_IP=10.29.49.1
Set
environment variables for the console port:
# export SERVER_CONS_PORT=902
# export ADMIN_CONS_PORT=902
Note: Always use port 902. This is hardcoded into the
vSphere client and cannot be changed.
Set an
environment variable with the vSphere management port on the physical
server:
# export SERVER_MGMT_PORT=443
Note: Always use port 443. This is hardcoded in ESXi
and cannot be changed.
Find
the next available port number on “admin.portal.fullcount.net”
# ps -ef | grep ssh | grep tunnel
Set an
environment variable with the next available port number on
“admin.portal.fullcount.net”
# export ADMIN_MGMT_PORT=53904
Set an
environment variable with hostname of the “admin” server:
# export ADMIN_HOSTNAME=admin.portal.fullcount.net
Run
the following command on the terminal you logged into in step 3:
# ssh \
-C \
-n \
-N \
-o ExitOnForwardFailure=yes \
-R ${ADMIN_CONS_PORT}:${SERVER_IP}:${SERVER_CONS_PORT} \
-R ${ADMIN_MGMT_PORT}:${SERVER_IP}:${SERVER_MGMT_PORT} \
${ADMIN_HOSTNAME}
Type
in the password for the user on the “admin” server and press Enter.
If
the connection is successful, you will not see any output.
Be
sure to leave this window until after you exit the vSphere client.
Start
the VMware vSphere Client application on your computer.
In the
“IP Address / Name” textbox:
Type
the hostname from step 9 followed by a colon (:).
Type
the port number from step 8.
Note: Make sure there aren’t any spaces between the
hostname and the colon.
In
the “User name” textbox:
Type
“root” (without quotes).
Click
on the “Login” button.
Click
on the “Ignore” button.
Click
on the “Inventory” icon.
Click
on the “+” near the top left.
Click
on the name of the VM.
Click
on the console tab.
Click
on the black area under the console tab.
Press
the space bar a few times to “wake up” the console.
After
the console wakes up, delete the spaces that you type.
Run
whichever commands you need to (filesystem check, etc.)
Press
Contol + Alt to release the cursor.
Exit
the vSphere client.
Press
Control + C in your SSH window to disconnect from the “admin” server.