locked
Dynamic port forwarding openSSH: Desktop -> gateway -> target_server RRS feed

  • Question

  • I connect from my Windows 10 desktop to a gateway (Linux jumphost) and from there to 10+ Linux target_servers
    I do this in 2 different ways:

    1) In CMD
    ...............A) ssh ab028583@gateway/jumpserver
    ...............B) from jumpserver ssh ab028583@target_server
    ...............C) I am prompted twice for password.
    ...............D) This works fine but it is cumbersome and not practical.

    2) With a Putty session including
    ...............A) Host Name="jumpserver"
    ...............B) "Remote Command"=ssh -L8081:localhost:8080 ab028583@target_server
    ...............C) c) Tunnels="L8081 localhost:8081"
    ...............D) This also works fine but it is cumbersome and not practical.

    Method 2) opens a tunnel and "localhost:8081" in a browser connects to target_server
    Both methods above work very well but are non practical and time out quickly.
    I don't create any SSH-keys at least that I know.

    I would love to implement an openSSH script to connect to each of the Linux target servers, including the userid and pwd in the script so I dont have to type it for each login.

    Also I would like to include flags so the connection does not time out:

    -o ServerAliveInterval=10 -o ServerAliveCountMax=15

    Can anyone help me on how such a script looks like?
    Sunday, August 16, 2020 8:09 PM