What to do when ctrl+c not killing your telnet command

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:

https://superuser.com/questions/486496/how-do-i-exit-telnet

About SoCRaT

Systems Engineer, OSS & Linux Geek
This entry was posted in Linux and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s