1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>telnet</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" />
<link rel="HOME" title="Slackware Linux Essentials" href="index.html" />
<link rel="UP" title="Basic Network Commands" href="basic-network-commands.html" />
<link rel="PREVIOUS" title="finger" href="basic-network-commands-finger.html" />
<link rel="NEXT" title="The Secure shell" href="basic-network-commands-ssh.html" />
<link rel="STYLESHEET" type="text/css" href="docbook.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"
alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<th colspan="3" align="center">Slackware Linux Essentials</th>
</tr>
<tr>
<td width="10%" align="left" valign="bottom"><a href="basic-network-commands-finger.html"
accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 13 Basic Network Commands</td>
<td width="10%" align="right" valign="bottom"><a href="basic-network-commands-ssh.html"
accesskey="N">Next</a></td>
</tr>
</table>
<hr align="LEFT" width="100%" />
</div>
<div class="SECT1">
<h1 class="SECT1"><a id="BASIC-NETWORK-COMMANDS-TELNET"
name="BASIC-NETWORK-COMMANDS-TELNET">13.5 <tt class="COMMAND">telnet</tt></a></h1>
<p>Someone once stated that <tt class="COMMAND">telnet</tt>(1) was the coolest thing he
had ever seen on computers. The ability to remotely log in and do stuff on another
computer is what separates Unix and Unix-like operating systems from other operating
systems.</p>
<p><tt class="COMMAND">telnet</tt> allows you to log in to a computer, just as if you
were sitting at the terminal. Once your username and password are verified, you are given
a shell prompt. From here, you can do anything requiring a text console. Compose email,
read newsgroups, move files around, and so on. If you are running X and you <tt
class="COMMAND">telnet</tt> to another machine, you can run X programs on the remote
computer and display them on yours.</p>
<p>To login to a remote machine, use this syntax:</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">%</samp> <kbd class="USERINPUT">telnet <<var
class="REPLACEABLE">hostname</var>></kbd>
</pre>
</td>
</tr>
</table>
<p>If the host responds, you will receive a login prompt. Give it your username and
password. That's it. You are now at a shell. To quit your telnet session, use either the
<tt class="COMMAND">exit</tt> command or the <tt class="COMMAND">logout</tt> command.</p>
<div class="WARNING">
<table class="WARNING" width="100%" border="0">
<tr>
<td width="25" align="CENTER" valign="TOP"><img src="./imagelib/admon/warning.png"
hspace="5" alt="Warning" /></td>
<td align="LEFT" valign="TOP">
<p><tt class="COMMAND">telnet</tt> does not encrypt the information it sends. Everything
is sent in plain text, even passwords. It is not advisable to use <tt
class="COMMAND">telnet</tt> over the Internet. Instead, consider the <tt
class="COMMAND">Secure Shell</tt>. It encrypts all traffic and is available for free.</p>
</td>
</tr>
</table>
</div>
<div class="SECT2">
<h2 class="SECT2"><a id="AEN4593" name="AEN4593">13.5.1 The other use of telnet</a></h2>
<p>Now that we have convinced you not to use the telnet protocol anymore to log into a
remote machine, we'll show you a couple of useful ways to use <tt
class="COMMAND">telnet</tt>.</p>
<p>You can also use the <tt class="COMMAND">telnet</tt> command to connect to a host on a
certain port.</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">%</samp> <kbd class="USERINPUT">telnet <<var
class="REPLACEABLE">hostname</var>> [port]</kbd>
</pre>
</td>
</tr>
</table>
<p>This can be quite handy when you quickly need to test a certain service, and you need
full control over the commands, and you need to see what exactly is going on. You can
interactively test or use an SMTP server, a POP3 server, an HTTP server, etc. this
way.</p>
<p>In the next figure you'll see how you can <tt class="COMMAND">telnet</tt> to a HTTP
server on port 80, and get some basic information from it.</p>
<div class="FIGURE"><a id="FIG-BASIC-NETWORK-COMMANDS-TELNET-WEB"
name="FIG-BASIC-NETWORK-COMMANDS-TELNET-WEB"></a>
<p><b>Figure 13-1. Telnetting to a webserver</b></p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">%</samp> <kbd class="USERINPUT">telnet store.slackware.com 80</kbd>
Trying 69.50.233.153...
Connected to store.slackware.com.
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Mon, 25 Apr 2005 20:47:01 GMT
Server: Apache/1.3.33 (Unix) mod_ssl/2.8.22 OpenSSL/0.9.7d
Last-Modified: Fri, 18 Apr 2003 10:58:54 GMT
ETag: "193424-c0-3e9fda6e"
Accept-Ranges: bytes
Content-Length: 192
Connection: close
Content-Type: text/html
Connection closed by foreign host.
<samp class="PROMPT">%</samp>
</pre>
</td>
</tr>
</table>
</div>
<p>You can do the same for other plain-text protocols, as long as you know what port to
connect to, and what the commands are.</p>
</div>
</div>
<div class="NAVFOOTER">
<hr align="LEFT" width="100%" />
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="basic-network-commands-finger.html"
accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html"
accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="basic-network-commands-ssh.html"
accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top"><tt class="COMMAND">finger</tt></td>
<td width="34%" align="center" valign="top"><a href="basic-network-commands.html"
accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">The Secure shell</td>
</tr>
</table>
</div>
</body>
</html>
|