Testing connectivity and port availability using SSH instead of Telnet – Unix & Linux Stack Exchange
Windows:
Port open:
C:\>ssh -p 121 p4-mfg
kex_exchange_identification: read: Connection reset
Port closed:
C:\>ssh -p 120 p4-mfg
ssh: connect to host p4-mfg port 120: Connection timed out
Linux:
Use the -p option. For example port open:
$ ssh -p 111 192.168.1.16
ssh_exchange_identification: read: Connection reset by peer
Port closed:
$ ssh -p 112 192.168.1.16
ssh: connect to host 192.168.1.16 port 112: Connection refused