Network Daemons  «Prev  Next»

Talking to servers using telnet

Here are the steps you needed to follow to successfully complete this exercise:
  1. You can use your telnet client to talk directly to many different services. In this exercise, you will work with several trivial TCP/IP services (the echo and daytime ports), then with port 80, which is the one generally used by the Hypertext Transfer Protocol (HTTP). First, telnet to Acme's Web server, using the actual port number for the echo port on that box. Remember: use the number for the port, not the name.
    Solution: telnet www.acmecorp.com 7
  2. Now, enter the following sentence: This is the echo port.
    Solution: This is the echo port.
  3. Press Enter.
    Solution: Enter
  4. Notice that the echo port returns exactly the same sentence you entered. Normally, you would end this telnet session by entering Ctrl + ].
    For this simulation, however, the telnet session is closed automatically for you. Note that the terminal reports a ^] signal upon exit. Now, learn the time of day on the West Coast of the United States by telnetting to the daytime port of Acme's Web server. Use the port number, not the name.
    Solution: telnet www.acmecorp.com 13
  5. You should see that the Web server gives the current time. Also, notice that the server drops the connection right after giving you the time. This behavior is standard for the daytime port. You need not issue a termination sequence (e.g., Ctrl + ]) in this case. In addition to the TCP/IP trivial services, you can use telnet to access various servers, including FTP and HTTP. Use telnet to open a connection with the www.acmecorp.com Web server's HTTP port. Use the port number.
    Solution: telnet www.acmecorp.com 80
  6. HTTP servers are not configured to expect human interaction, and therefore do not generate prompts. However, you can still get this server to give you information. For example, you can tell the server to send its default document, as specified by /. To get this information, issue the following command: GET / HTTP/1.0.
    Note: you must enter this command exactly as shown, so include the proper spacing.
    Solution: GET / HTTP/1.0
  7. Press Enter twice to create two blank lines that direct the Web server to transfer its information.
    Solution: Enter, Enter
  8. Note that the server will terminate the telnet connection immediately, because the server initiates a connection, then ends it as soon as the information is sent.