Re: ssh issue that I don't understand

<[email protected]> Wed, 8 Jul 2026 22:43:16 +0200
Newsgroups gmane.linux.debian.user
Message-ID <[email protected]>
On Wed, Jul 08, 2026 at 03:15:26PM +0200, Nicolas George wrote:
> Chris Green (HE12026-07-08):
> >     telnet <server> <port number>
> 
> Better use netcat / nc for that: telnet has an escaping character and
> does tty control, that could interfere with your interaction with the
> server.
> 
> And if you can change the syntax a little:
> 
> socat - tcp:server:port
> 
> is extremely more powerful.

Yesbut.

If you want to have the equivalent to telnet, you have to tell socat
to convert newlines to CR + LF, like so:

    tomas@caliban:~$ socat - TCP4:www.tuxteam.de:80,crnl
    GET / HTTP/1.0

    HTTP/1.0 403 Forbidden
    Content-Type: text/html
    Content-Length: 341
    Connection: close
    Date: Wed, 08 Jul 2026 20:38:26 GMT
    Server: lighttpd/1.4.59

    ...

(Note the ",crnl" option)

(Otherwise I get a "400 Bad Request" in my case: the web server wants
CR + LF terminated lines, as it should the "403 Forbidden" is the right
response)

So still telnet is slightly more convenient. No question that socat
is more powerful, in this case it also can do TLS and things).

Cheers
-- 
t
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCak62XQAKCRAFyCz1etHa
RsFjAJ4/AJOhPfYetnR8LM0b1WMpQdBKIwCeLdgiPKUKyj/71/A6ZCNiuGEhuOw=
=3Y3h
-----END PGP SIGNATURE-----