Comments on: “Jump in” with ssh and netcat https://backreference.org/2010/02/26/jump-in-with-ssh-and-netcat/ Proudly uncool and out of fashion Sun, 02 Dec 2012 12:44:45 +0000 hourly 1 https://wordpress.org/?v=5.8.2 By: waldner https://backreference.org/2010/02/26/jump-in-with-ssh-and-netcat/#comment-24691 Sat, 08 Oct 2011 15:32:54 +0000 http://backreference.org/?p=753#comment-24691 In reply to Nico.

Thanks, that should be a relatively recent addition. Looking at the changelog it seems it has been introduced in version 5.4:

* Added a 'netcat mode' to ssh(1): "ssh -W host:port ..." This connects
stdio on the client to a single port forward on the server. This
allows, for example, using ssh as a ProxyCommand to route connections
via intermediate servers. bz#1618

So I guess it could be used as something like (to keep the example in the article)

Host internal1
User root
ProxyCommand ssh -W 192.168.0.1:22 user@firewall

And indeed it works (with VisualHostKey ASCII art to make it more evident):

$ ssh internal1
Host key fingerprint is 01:b0:7a:87:ff:13:36:26:bd:e4:1c:ae:78:1f:72:34
+--[ RSA 1024]----+
|    ...          |
|     . .         |
|    .   .        |
|   +     .       |
| E+ .   S        |
|. .o             |
|....+            |
|oo.**o.          |
|o.o==+..         |
+-----------------+

Host key fingerprint is 90:47:e7:f8:a6:53:fa:14:4c:ff:3a:b3:9f:b7:ea:c0
+--[ECDSA  256]---+
|         .o .    |
|         o +     |
|        o o .    |
|         + o     |
|        S o =    |
|       .   * .   |
|        E =   .  |
|         +oo..   |
|         .*B+.   |
+-----------------+

Last login: Wed Oct  5 16:48:36 2011 from 10.18.0.233
internal1 #

Thanks!

]]>
By: Nico https://backreference.org/2010/02/26/jump-in-with-ssh-and-netcat/#comment-24690 Sat, 08 Oct 2011 15:13:13 +0000 http://backreference.org/?p=753#comment-24690 You can also use the builtin -W parameters in openssh:
-W host:port
Requests that standard input and output on the client be for‐
warded to host on port over the secure channel. Implies -N, -T,
ExitOnForwardFailure and ClearAllForwardings and works with Pro‐
tocol version 2 only.

]]>
By: luccino https://backreference.org/2010/02/26/jump-in-with-ssh-and-netcat/#comment-24663 Tue, 21 Jun 2011 12:28:39 +0000 http://backreference.org/?p=753#comment-24663 found a solution. thanks anyway

]]>
By: luccino https://backreference.org/2010/02/26/jump-in-with-ssh-and-netcat/#comment-24662 Mon, 20 Jun 2011 13:42:23 +0000 http://backreference.org/?p=753#comment-24662 Hey there,

i have a simliar problem then the other(s). I want to rsync between two server which i connected with Proxycommand. The Problem is the following. I have to sync from root to user httpd but my rsync can just log into user@privatserver.

If i just want to ssh to the server and switch the user "ssh -t privatserver 'sudo su - httpd' works fine but i dont know who to teach this to either rsync or Proxycommand. Do you have an solution ?

Thanks for the awesome tutorial

greetings luccino

PS: i hope you can understand what i mean, not sure about my english skills :P

]]>
By: Jianing Yang https://backreference.org/2010/02/26/jump-in-with-ssh-and-netcat/#comment-24647 Fri, 03 Jun 2011 13:35:50 +0000 http://backreference.org/?p=753#comment-24647 Thanks very much. It's really useful! :)

]]>