Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

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

  • 14-10-2019 10:19AM
    #1
    Registered Users, Registered Users 2 Posts: 5,777 ✭✭✭


    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