Monday, April 5, 2021

Accessing a SSH host via a SSH gateway?

I wrote the notes about how to synchronize two SSH hosts via a middle SSH gateway and how to access a SSH host via a SSH gateway. The assumption there is to use ssh in OpenSSH. But what if we want to do the same with PuTTY? I actually locate the answer on Stack Overflow. This post is just a bookmark to the answer.

Simply put, it is to use PuTTY's proxy setup on the user interface when we create a session for a host, and the proxy command follows the following format,


plink.exe %user@%proxyhost -P %proxyport -nc %host:%port

or


plink.exe %user@%proxyhost -pw %pass -P %proxyport -nc %host:%port

Note the two comments.

  1. plink.exe is part of the PuTTY suite.
  2. The second plink.exe example is to use the password authentication. Since the password is part of the command line, someone can reveal the password by showing the process command line arguments, such as, using the methods in the notes written here. So use it with caution.

No comments:

Post a Comment