To check if ports are open or not, we usually do the following:
telnet IP PORT
For example:
telnet 192.168.100.5 25
Sometimes after seeing your result, you keep pressing ctrl+c, ctrl+x or ctrl+\ to force quit it, but it just doesn’t! It seems silly I know and I feel a bit stupid for writing this, but it was driving me crazy at some point!
Anyway, just press ctrl+5 or ctrl+] and then type quit, that’s it!! This works the same way on Linux, MAC and Windows.
user@server:~$ telnet xxx.xx.xxx.xxx 25
Trying xxx.xx.xxx.xxx…
Connected to xxx.xx.xxx.xxx.
Escape character is '^]'.
220 *
^C^C^C^C^C^C^C^C^C^C^C^C^C
^C^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z
^\^\^\^\^\^\^\^\^\^\^\^\^\
^]
telnet> quit
Connection closed.
Sources: