1

I do need a tool that would work just like ping, but that shows me response on a given port.

I do know about telnet and nmap, but they give me only one result, not a constant loop, with which I could see changes over time.

is there anything like that?

2 Answers 2

1

The netcat utility will do exactly what you are looking for:

$ nc -lk 1234

The -l option will start netcat listening on a port. The -k option forces it to keep listening for new connections.

Netcat should be installed on your system by default; it is part of ubuntu-minimal. If not, you can install it with apt-get install netcat-openbsd.

0

I think you could do that with netcat (command : nc)

You could do like the following example (which can be found in netcat manpage !):

$ echo "QUIT" | nc <yourhost> 22
SSH-2.0-OpenSSH_6.0p1 Debian-3ubuntu1
Protocol mismatch.
$ # prompt returned here

You can specify a connection/idle timeout with -w flag. (see the manpage).

This example connects to the given port (here 22/SSH), read from it then send the string "QUIT". Note that "QUIT" string is arbitrary, depending on the expected protocol: with the example above it could be any string - the SSH server would terminate the connection.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .