-1

Every morning, and multiple times throughout the day, I need to open an ssh session to a VM that is behind a proxy-jump. Since putty doesn't have a native proxy-jump capability, I just log in to the jump server and ssh over. However, this is a bit cumbersome and prone to error if my attention slips between opening the jump-server and the ssh, which it will do in an office environment.

The most rated suggestions are to use Remote Commands, such as How to setup proxy jump with PuTTY and add the command I want to execute on connection. However, Remote Command does not work at all. It will not ssh (remote command = 'ssh {destination IP}'), nor will it even echo or cd or ls. The only thing that happens when I pass a Remote Command to the jump server is that it will not print the MoTD and leave me at prompt like normal. What can I do to troubleshoot this?

Attempting to use plink instead of Remote Command:

(Attempt #1)

  • Created new session. Host Name (or IP address) = {ProxyJump IP} on port 22 (SSH).
  • Connection -> Proxy. Proxy type = local. Proxy hostname = {ProxyJump IP}. Port = 22. Username = {username}. Password = {password}. Telnet command, or local proxy command = 'plink.exe %user@%proxyhost -nc %host:%port'
  • Result: Blank screen where title = {ProxyJump IP}. No prompt. No Destination VM IP given, so wouldn't work in hindsight.

(Attempt #2)

  • Created new session. Host Name (or IP address) = {Destination VM IP} on port 22 (SSH).
  • Connection -> Proxy. Proxy type = local. Proxy hostname = {ProxyJump IP}. Port = 22. Username = {username}. Password = {password}. Telnet command, or local proxy command = 'plink.exe %user@%proxyhost -nc %host:%port'
  • Result: Blank screen where title = {Destination VM IP}. No prompt.

(Attempt #3) After seeing Putnik's comment on https://stackoverflow.com/questions/28926612/putty-configuration-equivalent-to-openssh-proxycommand, I added my path to my ssh key.

  • Created new session. Host Name (or IP address) = {Destination VM IP} on port 22 (SSH).
  • Connection -> Proxy. Proxy type = local. Proxy hostname = {ProxyJump IP}. Port = 22. Username = {username}. Password = {password}. Telnet command, or local proxy command = 'plink.exe %user@%proxyhost -ssh -i {path/to/key} -nc %host:%port'
  • Result: Prompts for username. Once entered, logs me in as I would expect it to!

1 Answers1

-1

After trying multiple ways, the short answer is: No. Remote Command does not work this way.

An alternative, as suggested via, Martin Prikryl, is instead of using SSH: Remote Command, use the Connection->Proxy option with plink.exe.

I created a session pointing to my destination VM IP that exists behind the proxyJump. Then, in Connection->Proxy I set up a local proxy where the proxy host name is my ProxyJump server's IP, and for the 'local proxy command' I used "plink.exe %user@%proxyhost -ssh -i path\to\key.ppk -nc %host:%port"

I still have to enter my username even if I try adding it in the Username field, or if I replace the '%user' in the local command with my username, but this is good enough for what I want.