<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:foaf="https://xmlns.com/foaf/0.1/" xmlns:og="https://ogp.me/ns#" xmlns:rdfs="https://www.w3.org/2000/01/rdf-schema#" xmlns:schema="https://schema.org/" xmlns:sioc="https://rdfs.org/sioc/ns#" xmlns:sioct="https://rdfs.org/sioc/types#" xmlns:skos="https://www.w3.org/2004/02/skos/core#" xmlns:xsd="https://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/telnet">
  <channel>
    <title>telnet</title>
    <link>https://www.linuxjournal.com/tag/telnet</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Troubleshooting with Telnet</title>
  <link>https://www.linuxjournal.com/content/troubleshooting-telnet</link>
  <description>  &lt;div data-history-node-id="1084357" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/network_0.jpg" width="500" height="334" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/kyle-rankin" lang="" about="https://www.linuxjournal.com/users/kyle-rankin" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Kyle Rankin&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
Poor telnet, it used to be the cool kid on the block. It was the program all
sysadmins turned to when they needed to connect to a remote server. Telnet
just wasn't that good at keeping a secret—all communication went over plain
text—so administrators started switching to SSH for encrypted remote shell
sessions. Of course, along with the switch came a huge stigma against
administrators who still used telnet. Eventually, telnet became an
outcast—the program you used if you were an out-of-touch old-timer who
didn't care about security.
&lt;/p&gt;

&lt;p&gt;
I for one think telnet isn't all bad. Sure, it can't keep a secret, but it
still can do a lot of useful things around the server room. Really, telnet
just provides you a convenient way to connect to a network port and send
commands. Telnet can work well to diagnose problems with one of the many
services out there that still accept plain-text commands in their protocol.
In fact, it's one of my go-to command-line programs when I'm
troubleshooting. In this column, I'm going to give telnet a second chance and
describe how to use it to perform some common troubleshooting tasks.
&lt;/p&gt;

&lt;h3&gt;
Test Remote Ports&lt;/h3&gt;

&lt;p&gt;
There are many different ways to test whether a network port is listening on
a system, including GUI port scanners, Nmap and nc. Although all of those can
work well, and even I find myself using Nmap more often than not, not all
machines end up having Nmap installed. Just about every system includes
telnet though, including a lot of embedded systems with BusyBox
environments. So if I wanted to test whether the SMTP port (port 25) was
listening on a server with the IP 192.168.5.5, I could type:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
$ telnet 192.168.5.5 25
Trying 192.168.5.5...
telnet: Unable to connect to remote host: Connection refused
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
In this case, the remote port is unavailable, so I would fall back to some
other troubleshooting methods to figure out why. If the port were open and
available though, I could just start typing SMTP commands (more on
that later).
&lt;/p&gt;

&lt;p&gt;
As you can see from the above example, the syntax is to type the command
&lt;code&gt;telnet&lt;/code&gt;, the IP or hostname to connect to, and the remote port (otherwise it
will default to port 23—the default port for telnet). So if I wanted to
test a Web server instead, I would connect to the HTTP port (port 80):

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
$ telnet www.example.net 80
&lt;/code&gt;&lt;/pre&gt;


&lt;h3&gt;
Troubleshoot Web Servers&lt;/h3&gt;

&lt;p&gt;
While you are connecting to port 80, you might as well actually throw some
HTTP commands at it and test that it works. For starters, you want to make
sure you actually are connected:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
$ telnet www.example.net 80
Trying 192.168.5.5...
Connected to www.example.net.
Escape character is '^]'.
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
Once you are connected, you can pass a basic HTTP GET request to ask for the
default index page followed by the host you want to connect to:

&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/troubleshooting-telnet" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Fri, 01 Mar 2013 16:58:05 +0000</pubDate>
    <dc:creator>Kyle Rankin</dc:creator>
    <guid isPermaLink="false">1084357 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
