Podcast 2x04: advanced SSH
Translation of the original in Catalan. Read it in: CatalàCastellano
The podcast
Notes about the podcast
-
-L: connects over SSH to a HOST. Once there it opens a TCP connection to another HOST:PORT and opens a local TCP port that, when we connect to it, sends us to the previous HOST:PORT, that is, portforwarding.
-
-L [bind_address:]port:host:hostport]
-
-W: connects over SSH to a HOST, once there it opens a TCP connection to another HOST:PORT and returns to stdin/stdout the content of that last TCP link
-
-W host:hostport
-
-R publish a port: connects over SSH to a host and once there publishes a TCP port, when a client connects to this TCP port it reaches over SSH the machine that launched the SSH link and opens another TCP link to another IP:PORT.
-
-R[bind_address:]port:host:hostport
-
-D socks5: connects over SSH to a HOST and then publishes a SOCKS5/TCP port, that is, we can connect to this local port and go out to the internet through the IP of the HOST we connected to over SSH
-
-D [bind_address:]port
-
-w tunnel: connects over SSH to a HOST and the socket used to make the SSH link is connected to two TUN type interfaces, one at each end of the socket. So, if we configure the corresponding IPs on the TUN interfaces we have a tunnel/VPN set up between the ends.
-
-w local_tun[:remote_tun]
HPN-SSH
The website of: HPN-SSH -> especially interesting: Dynamic Windows and None Cipher
-
it works with a dynamic window size
-
it works without encryption when a link has no terminal associated, often used to pass files
The tests:
-
Openssh 5.3p1 + hpn-13 (only the patch: Dynamic Windows and None Cipher)
-
after applying the patch: openssh5.3-dynwindow_noneswitch.diff.gz
-
we modify the file: sshconnect2.c
<br><pre>linia: 366<br>- if (!tty_flag) /* no null on tty sessions */<br>+ if (1) /* no null on tty sessions */</pre><br>
this way we can do SSH without encryption only after having logged in.
wide bandwidth example of an SSH with aes128-ctr encryption, using a dynamic window:
scp -v -oNoneEnabled=no -oNoneSwitch=yes fitxer root@127.0.0.1:/tmp/ssh
o
ssh -v -oNoneEnabled=no -oNoneSwitch=yes root@127.0.0.1 "dd if=/dev/zero"|pv > /dev/null
velocitat de transferència: <strong>13.7MB/s</strong>
- debug ciphers, a single ciphers negotiation:
debug1: AUTH STATE IS 0
debug1: REQUESTED ENC.NAME is '<strong>aes128-ctr</strong>'
debug1: kex: server-><strong>client</strong> aes128-ctr hmac-md5 none
debug1: REQUESTED ENC.NAME is '<strong>aes128-ctr</strong>'
debug1: kex: client-><strong>server</strong> aes128-ctr hmac-md5 none
example without encryption, using a dynamic window:
scp -v -oNoneEnabled=yes -oNoneSwitch=yes fitxer root@127.0.0.1:/tmp/ssh
o
ssh -v -oNoneEnabled=yes -oNoneSwitch=yes root@127.0.0.1 "dd if=/dev/zero"|pv > /dev/null
velocitat de transferència: <strong>37.4MB/s</strong>
- before the login pass:
debug1: <strong>AUTH</strong> STATE IS <strong>0</strong>
debug1: REQUESTED ENC.NAME is '<strong>aes128-ctr</strong>'
debug1: kex: server-><strong>client</strong> aes128-ctr hmac-md5 none
debug1: REQUESTED ENC.NAME is '<strong>aes128-ctr</strong>'
debug1: kex: client-><strong>server</strong> aes128-ctr hmac-md5 none
- after authenticating:
debug1: <strong>AUTH</strong> STATE IS <strong>1</strong>
debug1: REQUESTED ENC.NAME is '<strong>none</strong>'
debug1: Requesting NONE. Authflag is 1
debug1: None requested post authentication.
debug1: kex: server-><strong>client</strong> none hmac-md5 none
debug1: REQUESTED ENC.NAME is '<strong>none</strong>'
debug1: Requesting NONE. Authflag is 1
debug1: None requested post authentication.
debug1: kex: client-><strong>server</strong> none hmac-md5 none