Wednesday, May 14, 2014

How to test a TCP or UDP port in linux

from http://superuser.com/questions/621870/test-if-a-port-on-a-remote-system-is-reachable-without-telnet

is this localhost's SSH running?
$ cat < /dev/tcp/localhost/22
SSH-2.0-OpenSSH_6.2p2 Debian-6
YEP

is port 8080 on 192.168.30.5 open?
$ cat < /dev/tcp/192.168.30.5/8080
-bash: connect: Connection refused
-bash: /dev/tcp/192.168.30.30/8080: Connection refused
NOPE

No comments: