Stop using Telnet to test ports
redhat.com
redhat.com
Vs
> telnet raspberrypi 22
No, I will keep using telnet over netcat. I’m not remembering and looking up those switches over and over.
If I’m automating port checks, I’m probably using neither. But if I want to check if something is listening then I can remember the telnet command and will use that.
expect requires me to know a fairly niche DSL, and the bash version requires me to remember a bunch of arcane info like the ability to make TCP connections by echoing into /dev.
I would push back on an MR with either of the first two. The bash+nc one I could live with, though.
Not sure why nc is that much better for me to tell if something is listening on a port.
> This works perfectly fine, assuming you're testing only one service and one port
... which is what I'm doing about 99% of the time.
I usually don't use telnet just because it's usually (annoyingly) not installed any more, so I have to stop and try to remember how to do the same thing with nc.
While the content in the article is useful the title is misleading.
No machine I deploy has the telnet command present because I don't want to give my users free footguns.
What do people who end up doing haxxy dev work in windows do in these kind of situations (testing if ports are listening / open in Docker containers / WSL, listing out listening ports). It seems the tooling is often "Use this tool (telnet) in a hacky way", or "Download this horrible GUI".
Windows has ping and tracert installed and working without administrative priviliges by default. Truly extraordinary feat many Linux distros are still not able to achieve.
And in my experience 99.9% network issues are debugged with the trio of ping/tracert/telnet.
Yeah telnet just about does it, unfortunately not for UDP ports though, and still lacking a built in way to see what port is being held without grabbing procexp. It still feels like if you've got WSL sat there, thats still a much more capable place to mess about with this stuff (and this is coming from someone who spent the first half of their career building out Windows Server deployments).
I borrowed the nc approach from one of the answers on this SO thread, which has some moderately interesting stuff in it:
https://stackoverflow.com/questions/4922943/test-if-remote-t...
I also hate the title of this article, really sick of seeing "Stop using X".
telnet was not made for UDP
Use netcat instead if you are not sure which one it is.
https://community.cisco.com/t5/switching/telnet-tcp-udp-port...
Text: For example: $ telnet raspberrypi 8086 [...] This works perfectly fine.