Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am just trying some really basic Telnet as part of a HTTP tutorial, but everything I've read assumes that the Enter key works very differently than how it's been working for me so far.

So an example like:

Microsoft Telnet>o 80
Connecting To
Microsoft Telnet>GET / HTTP/1.1 [ENTER]
Host: [ENTER]

Doesn't work at all for me because as soon as I press Enter key the first time, I immediately get

Invalid Command. type /?help for help

So I never even get the chance to complete the GET command.

I've tried having set crlf turned on and off, and that doesn't make a difference. Tried using Ctrl/Shift/Alt-Enter to get it to put in a newline instead of submitting the command, and no luck.

I've googled around a lot, and every tutorial / forum / etc. just assumes that the Enter key puts a LF or CRLF in and that you have to hit Enter twice to submit the command; I haven't found anything that addresses what to do if that is not the case.

I'm on Windows 7, with Telnet Client featured turned on, in a regular Command Prompt.

share|improve this question

closed as off topic by Sven, mdpc, Dennis Kaarsemaker, dunxd, Wesley Apr 1 '13 at 1:05

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

It'll work fine if you do telnet <ip> <port> – gparent Mar 28 '13 at 18:24
@gparent No, that hasn't made any difference for me. – East of Nowhere Mar 28 '13 at 22:10
Weird, my bad. Usually works fine for me. Good luck! – gparent Mar 29 '13 at 3:50
Also: Apologies for the off topic question --- it looks like this would have been more appropriate for than serverfault. My bad! – East of Nowhere Apr 1 '13 at 14:20
up vote 1 down vote accepted

You were in command mode. Thus you were sending those commands to the telnet client, not to the open connection to the remote host.

To switch back to the open connection, press Enter (alone) at the telnet prompt. (And press Ctrl+] to switch back to command mode.)

share|improve this answer
That got some progress: pressing Enter like that does allow me to put in Microsoft Telnet>GET / HTTP/1.1 [ENTER] Host: [ENTER] and it must be sending the GET request after all because I'm getting a HTTP/1.0 400 Bad Request for every URL I try. I don't know if that's a problem with the telnet command I'm trying or if most web servers nowadays just reject telnet on principle, though... – East of Nowhere Mar 28 '13 at 21:06
Press Enter first, before you send the GET. – Michael Hampton Mar 28 '13 at 21:09
Still a Bad Request. But at least telnet is definitely sending something to the server! – East of Nowhere Mar 28 '13 at 21:15
Update - the Bad Request bit seemed to have something to do with me being behind a proxy at the time -- I tried all those steps on a different workstation later and finally got HTTP 200. – East of Nowhere Apr 1 '13 at 14:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.