linux – Test if a port on a remote system is reachable (without telnet) – Super User
Posted by jpluimers on 2019/01/29
Just learned that bash can do TCP and UDP itself:
Bash has been able to access TCP and UDP ports for a while. From the man page:
/dev/tcp/host/port If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open a TCP connection to the corresponding socket. /dev/udp/host/port If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open a UDP connection to the corresponding socket.So you could use something like this:
xenon-lornix:~> cat < /dev/tcp/127.0.0.1/22 SSH-2.0-OpenSSH_6.2p2 Debian-6 ^C pressed hereTaa Daa!
This for systems that do not have telnet installed (Windows stopped using this a long time ago, many Linux distributions followed suit) and you cannot to use nc (also known as netcat).
–jeroen: [WayBack] linux – Test if a port on a remote system is reachable (without telnet) – Super User






Leave a comment