I had a hard time quitting telnet while logged in via the terminal (on Ubuntu). Here's some notes I found that worked:
1. Open the telnet prompt by holding down the ‘Ctrl’ key and push the ‘]’ key. (prompt: Microsoft Telnet>)
2. Type quit.
3. Push the ‘Enter’ key.
You can change this default telnet prompt key by starting telnet like this:
telnet –e p 192.168.1.81 (this will change the telnet prompt key to lowercase ‘p’)