-1

I remember one of my friend is using ssh file configuration to make it be done, but I can't find the command that should be written in that file to achieve this result.

So what he did is just type the command ssh [alias of the server] and the shell automatically go to jumper (proxy) submit the password in there, then go to the server and again submit the password there, so he doesn't need to re-enter password during ssh into the server.

Another question, is this able to be done for Windows server?

Darryl RN
  • 7,432
  • 4
  • 26
  • 46

2 Answers2

-1

I've never tried this except with public key authentication, but assuming:

  1. You want to ssh from origin-box to target-box
  2. target-box has a network name of target.box.domain
  3. origin-box is not authorized on target-box
  4. proxy-box is authorized on target-box
  5. origin-box is authorized on proxy-box

You ssh/config on origin-box would be something like:

Host target-box
    ProxyCommand ssh -q proxy-box -W target.box.domain
Jef
  • 1,128
  • 9
  • 11
-1

You can use something like this:

Host jump
        User [username]
        HostName [ip address]

Host [server ip address] [server alias]
        HostName [server ip address]
        User [username]
        Port [port]
        ProxyCommand ssh -q -W %h:%p jump 2>/dev/null

Host Jump is a proxy server.

The command that will help you take a leap on the proxy server then continue to the server is ProxyCommand.

  • %h: is using your username
  • %p: is using your password from id_rsa.pub.

Reference: https://www.ssh.com/ssh/config/