How to connect to the remote server via jump host using SSH on Windows
Jump hosts are mainly used for security reasons, which caused trouble for Windows users to connect to the remote server via SSH. This article provides a simple way to connect to the remote server via jump host using SSH.
The idea is that we convert the existing private key to .pem file and use Bash to connect to the remote server with SSH.
PART 1. Convert the private key as .pem file.
0. Prepare your private key pairs that are authenticated to connect to the remote server.
1. Download and install PuTTy, a free SSH and Telnet client for Windows, from here.
2. Open PuTTY Key Generator(PuTTYgen).

3. Load
your existing private key file, then click Conversions
. From the dropdown, select Export OpenSSH Key
.
4. Save it as a .pem
file, e.g. my_pvk.pem.
5. Move the file to ~/.ssh
or C:/User/$USER/.ssh
folder. You can use the following command line:
$ mv {the pem file path}/my_pvk.pem C:/User/$USER/.ssh/my_pvk.pem
PART 2. Prepare the SSH config
1. Type the following in the command line:
$ vim C:/User/$USER/.ssh/config
2. Edit the necessary information and copy and paste the following:
# jump server for remote
Host jump
HostName IP_for_jump
User your_user_name
IdentityFile ~/.ssh/my_pvk.pem# remote server
Host remote
HostName IP_for_remote
User your_user_name
IdentityFile ~/.ssh/my_pvk.pem
ProxyCommand ssh jump -W %h:%p
PART 3. Use Bash
The easiest way to use Bash on Windows would be Git Bash. You can download Git here, it comes with Git Bash.
- Open Git Bash from Windows Start.
- Type the following, then you should be good to go!
$ ssh remote
The above ideas mimicked the same process on Mac. Forget me if it’s not perfect. ;)