Use "logout" command to quit telnet.
Quit telnet
msh> logout
A confirmation message appears.
{yes|no|return}
Enter [yes], [no] or [return] by typing the word, and then press the [Enter] key.
To save the changes and quit telnet, enter [yes].
To discard the changes and quit telnet, enter [no].
To continue making changes, enter [return]