Check ports if we don't have access to Telnet

In a project I'm helping sometimes as the support guy,so in the machine that I was working isn't posible to install anything and Telnet wasn't installed, one solution is using curl.

Command Line


curl -v telnet://ip:port
ip: the host that we want to check.
port: the port that we want to validate.

Example

Let's try to check if my RasberryPi is using the default ssh port.

curl  -v telnet://192.168.1.138:22
The response is something like this:
*   Trying 192.168.1.138:22...
* TCP_NODELAY set
* Connected to 192.168.1.138 (192.168.1.138) port 22 (#0)
SSH-2.0-OpenSSH_8.4p1 Debian-5+deb11u1
source

No comments: