Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

OpenSsh: Multi Hop command not working (ssh -J)

Options
  • 14-10-2019 11:19am
    #1
    Registered Users Posts: 5,540 ✭✭✭


    Running the below command from my git bash on local laptop to enable port forwarding 2 hops away. Purpose of same is to allow me to access web results from address2 to view on my laptop.

    I can only currently access by sshing to address1 and onwards to address2.

    Here is the output.
    $ ssh -D 9999 -J root@address1.company.com root@address2.company.com
    ssh: Could not resolve hostname address1.company.com: Name or service not known
    kex_exchange_identification: Connection closed by remote host
    

    I can't see why this is as address1 (name changed to protect the innocent) is ssh'able directly without args.

    Seems to happen even without the second hop listed.
    $ ssh -D 9999 -J root@address1.company.com
    usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
               [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
               [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
               [-i identity_file] [-J [user@]host[:port]] [-L address]
               [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
               [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
               [-w local_tun[:remote_tun]] destination [command]
    
    My version of openssh is 8.0 so it should have the -J option working

    linux bash ssh portforwarding openssh


Advertisement