Skip to main content
added "middle" and "destination" as requested by CPBL for clearer explanation
Source Link
abu
  • 121
  • 4

Thanks a lot @rudimeier for your answer.

I had a problem with nc option when using ssh, but this variation (based on what @aDroid explained here) did work for me. So this is essentially the same one-liner answer of @rudimeier for newer versions of OpenSSH:

$ ssh -X -oProxyCommand="ssh [email protected] -W %h:%p" [email protected]

@user4556274 answer did also work for me (thanks to you as well).

I just would add usernames in both steps to clarify how it works to newbies like me (after typing 1st command, localhost port 2222 will behave as if it was port 22 in machine B; so in 2nd command we pass username of machine B):

$ ssh -Nf -L2222:destination.host-B.address.B:22 [email protected]-A.address.A
$ ssh -p 2222 -X userB@localhost

Thanks a lot @rudimeier for your answer.

I had a problem with nc option when using ssh, but this variation (based on what @aDroid explained here) did work for me. So this is essentially the same one-liner answer of @rudimeier for newer versions of OpenSSH:

$ ssh -X -oProxyCommand="ssh [email protected] -W %h:%p" [email protected]

@user4556274 answer did also work for me (thanks to you as well).

I just would add usernames in both steps to clarify how it works to newbies like me (after typing 1st command, localhost port 2222 will behave as if it was port 22 in machine B; so in 2nd command we pass username of machine B):

$ ssh -Nf -L2222:destination.host.address.B:22 [email protected].A
$ ssh -p 2222 -X userB@localhost

Thanks a lot @rudimeier for your answer.

I had a problem with nc option when using ssh, but this variation (based on what @aDroid explained here) did work for me. So this is essentially the same one-liner answer of @rudimeier for newer versions of OpenSSH:

$ ssh -X -oProxyCommand="ssh [email protected] -W %h:%p" [email protected]

@user4556274 answer did also work for me (thanks to you as well).

I just would add usernames in both steps to clarify how it works to newbies like me (after typing 1st command, localhost port 2222 will behave as if it was port 22 in machine B; so in 2nd command we pass username of machine B):

$ ssh -Nf -L2222:destination.host-B.address:22 [email protected]-A.address
$ ssh -p 2222 -X userB@localhost
added "middle" and "destination" as requested by CPBL for clearer explanation
Source Link
abu
  • 121
  • 4

Thanks a lot @rudimeier for your answer.

I had a problem with nc option when using ssh, but this variation (based on what @aDroid explained here) did work for me. So this is essentially the same one-liner answer of @rudimeier for newer versions of OpenSSH:

$ ssh -X -oProxyCommand="ssh [email protected] -W %h:%p" [email protected]

@user4556274 answer did also work for me (thanks to you as well).

I just would add usernames in both steps to clarify how it works to newbies like me (after typing 1st command, localhost port 2222 will behave as if it was port 22 in machine B; so in 2nd command we pass username of machine B):

$ ssh -Nf -L2222:destination.host.address.B:22 userA@host[email protected].address.A
$ ssh -p 2222 -X userB@localhost

Thanks a lot @rudimeier for your answer.

I had a problem with nc option when using ssh, but this variation (based on what @aDroid explained here) did work for me. So this is essentially the same one-liner answer of @rudimeier for newer versions of OpenSSH:

$ ssh -X -oProxyCommand="ssh [email protected] -W %h:%p" [email protected]

@user4556274 answer did also work for me (thanks to you as well).

I just would add usernames in both steps to clarify how it works to newbies like me (after typing 1st command, localhost port 2222 will behave as if it was port 22 in machine B; so in 2nd command we pass username of machine B):

$ ssh -Nf -L2222:host.address.B:22 userA@host.address.A
$ ssh -p 2222 -X userB@localhost

Thanks a lot @rudimeier for your answer.

I had a problem with nc option when using ssh, but this variation (based on what @aDroid explained here) did work for me. So this is essentially the same one-liner answer of @rudimeier for newer versions of OpenSSH:

$ ssh -X -oProxyCommand="ssh [email protected] -W %h:%p" [email protected]

@user4556274 answer did also work for me (thanks to you as well).

I just would add usernames in both steps to clarify how it works to newbies like me (after typing 1st command, localhost port 2222 will behave as if it was port 22 in machine B; so in 2nd command we pass username of machine B):

$ ssh -Nf -L2222:destination.host.address.B:22 [email protected].address.A
$ ssh -p 2222 -X userB@localhost
Source Link
abu
  • 121
  • 4

Thanks a lot @rudimeier for your answer.

I had a problem with nc option when using ssh, but this variation (based on what @aDroid explained here) did work for me. So this is essentially the same one-liner answer of @rudimeier for newer versions of OpenSSH:

$ ssh -X -oProxyCommand="ssh [email protected] -W %h:%p" [email protected]

@user4556274 answer did also work for me (thanks to you as well).

I just would add usernames in both steps to clarify how it works to newbies like me (after typing 1st command, localhost port 2222 will behave as if it was port 22 in machine B; so in 2nd command we pass username of machine B):

$ ssh -Nf -L2222:host.address.B:22 [email protected]
$ ssh -p 2222 -X userB@localhost