Commit | Line | Data |
---|---|---|
24854a1c KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
5c2bded5 | 5 | .\" @(#)telnet.1 6.3 (Berkeley) %G% |
24854a1c | 6 | .\" |
12f553b7 | 7 | .TH TELNET 1C "" |
24854a1c KM |
8 | .UC 5 |
9 | .SH NAME | |
5c2bded5 GM |
10 | telnet \- user interface to the |
11 | .B TELNET | |
12 | protocol | |
24854a1c KM |
13 | .SH SYNOPSIS |
14 | telnet [ host [ port ] ] | |
15 | .SH DESCRIPTION | |
16 | .I Telnet | |
5c2bded5 GM |
17 | is used to communicate with another host using the |
18 | .B TELNET | |
19 | protocol. | |
20 | If | |
24854a1c KM |
21 | .I telnet |
22 | is invoked without arguments, it enters command mode, | |
23 | indicated by its prompt (\*(lqtelnet>\*(rq). | |
24 | In this mode, it accepts and executes the commands listed below. | |
25 | If it is invoked with arguments, it performs an | |
5c2bded5 | 26 | .B open |
24854a1c KM |
27 | command (see below) with those arguments. |
28 | .PP | |
29 | Once a connection has been opened, | |
30 | .I telnet | |
5c2bded5 GM |
31 | enters an input mode. |
32 | The input mode entered will be either \*(lqcharacter at a time\*(rq | |
33 | or \*(lqline by line\*(rq | |
34 | depending on what the remote system supports. | |
35 | .PP | |
36 | In \*(lqcharacter at a time\*(rq mode, most | |
37 | text typed is immediately sent to the remote host for processing. | |
38 | .PP | |
39 | In \*(lqline by line\*(rq mode, all text is echoed locally, | |
40 | and (normally) only completed lines are sent to the remote host. | |
41 | The \*(lqlocal echo character\*(rq (initially \*(lq^E\*(rq) may be used | |
42 | to turn off and on the local echo | |
43 | (this would mostly be used to enter passwords | |
44 | without the password being echoed). | |
45 | .PP | |
46 | In either mode, if the | |
47 | .I localchars | |
48 | toggle (see below) is TRUE, | |
49 | the user's | |
50 | .IR quit , | |
51 | .IR intr , | |
52 | and | |
53 | .I flush | |
54 | characters are trapped locally, and sent as | |
55 | .B TELNET | |
56 | protocol sequences to the remote side. | |
57 | There are options (see | |
58 | .B toggle | |
59 | .I autoflush | |
60 | and | |
61 | .B toggle | |
62 | .I autosynch | |
63 | below) | |
64 | which cause this action to flush subsequent output to the terminal | |
65 | (until the remote host acknowledges the | |
66 | .B TELNET | |
67 | sequence) and flush previous terminal input | |
68 | (in the case of | |
69 | .I quit | |
70 | and | |
71 | .IR intr ). | |
72 | .PP | |
73 | While connected to a remote host, | |
24854a1c | 74 | .I telnet |
5c2bded5 | 75 | command mode may be entered by typing the |
24854a1c | 76 | .I telnet |
12f553b7 | 77 | \*(lqescape character\*(rq (initially \*(lq^]\*(rq). |
24854a1c KM |
78 | When in command mode, the normal terminal editing conventions are available. |
79 | .PP | |
5c2bded5 GM |
80 | .B COMMANDS |
81 | .PP | |
24854a1c | 82 | The following commands are available. |
5c2bded5 GM |
83 | Only enough of each command to uniquely identify it need be typed |
84 | (this is also true for arguments to the | |
85 | .BR mode , | |
86 | .BR set , | |
87 | .BR toggle , | |
88 | and | |
89 | .B display | |
90 | commands). | |
24854a1c KM |
91 | .PP |
92 | .TP | |
5c2bded5 GM |
93 | .B open \fIhost\fP \fR[\fP \fIport\fP \fR]\fP |
94 | .br | |
95 | Open a connection to the named host. | |
96 | If no port number | |
24854a1c KM |
97 | is specified, |
98 | .I telnet | |
5c2bded5 GM |
99 | will attempt to contact a |
100 | .B TELNET | |
101 | server at the default port. | |
24854a1c KM |
102 | The host specification may be either a host name (see |
103 | .IR hosts (5)) | |
5c2bded5 GM |
104 | or an Internet address specified in the \*(lqdot notation\*(rq (see |
105 | .IR inet (3N)). | |
24854a1c KM |
106 | .TP |
107 | .B close | |
5c2bded5 GM |
108 | .br |
109 | Close a | |
110 | .B TELNET | |
111 | session and return to command mode. | |
24854a1c KM |
112 | .TP |
113 | .B quit | |
5c2bded5 GM |
114 | .br |
115 | Close any open | |
116 | .B TELNET | |
117 | session and exit | |
24854a1c | 118 | .IR telnet . |
3c604e97 | 119 | An end of file (in command mode) will also close a session and exit. |
24854a1c KM |
120 | .TP |
121 | .B z | |
5c2bded5 | 122 | .br |
24854a1c KM |
123 | Suspend |
124 | .IR telnet . | |
125 | This command only works when the user is using the | |
126 | .IR csh (1). | |
127 | .TP | |
5c2bded5 GM |
128 | .B mode \fItype\fP |
129 | .br | |
130 | .I Type | |
131 | is either | |
132 | .I line | |
133 | (for \*(lqline by line\*(rq mode) | |
134 | or | |
135 | .I character | |
136 | (for \*(lqcharacter at a time\*(rq mode). | |
137 | The remote host is asked for permission to go into the requested mode. | |
138 | If the remote host is capable of entering that mode, the requested | |
139 | mode will be entered. | |
24854a1c KM |
140 | .TP |
141 | .B status | |
5c2bded5 | 142 | .br |
24854a1c KM |
143 | Show the current status of |
144 | .IR telnet . | |
145 | This includes the peer one is connected to, as well | |
5c2bded5 GM |
146 | as the current mode. |
147 | .TP | |
148 | .B display \fR[\fP \fIargument...\fP \fR]\fP | |
149 | .br | |
150 | Displays all, or some, of the | |
151 | .B set | |
152 | and | |
153 | .B toggle | |
154 | values (see below). | |
155 | .TP | |
156 | .B ? \fR[\fP \fIcommand\fP \fR]\fP | |
157 | .br | |
24854a1c KM |
158 | Get help. With no arguments, |
159 | .I telnet | |
160 | prints a help summary. | |
161 | If a command is specified, | |
162 | .I telnet | |
5c2bded5 GM |
163 | will print the help information for just that command. |
164 | .TP | |
165 | .B send \fIarguments\fP | |
166 | .br | |
167 | Sends one or more special character sequences to the remote host. | |
168 | The following are the arguments which may be specified | |
169 | (more than one argument may be specified at a time): | |
170 | .RS | |
171 | .TP | |
172 | .I escape | |
173 | .br | |
174 | Sends the current | |
175 | .I telnet | |
176 | escape character (initially \*(lq^]\*(rq). | |
177 | .TP | |
178 | .I synch | |
179 | .br | |
180 | Sends the | |
181 | .B TELNET SYNCH | |
182 | sequence. | |
183 | This sequence causes the remote system to discard all previously typed | |
184 | (but not yet read) input. | |
185 | This sequence is sent as TCP urgent | |
186 | data (and may not work if the remote system is a 4.2 BSD system -- if | |
187 | it doesn't work, a lower case \*(lqr\*(rq may be echoed on the terminal). | |
188 | .TP | |
189 | .I brk | |
190 | .br | |
191 | Sends the | |
192 | .B TELNET BRK | |
193 | (Break) sequence, which may have significance to the remote | |
194 | system. | |
195 | .TP | |
196 | .I ip | |
197 | .br | |
198 | Sends the | |
199 | .B TELNET IP | |
200 | (Interrupt Process) sequence, which hopefully will cause the remote | |
201 | system to abort the currently running process. | |
202 | .TP | |
203 | .I ao | |
204 | .br | |
205 | Sends the | |
206 | .B TELNET AO | |
207 | (Abort Output) sequence, which should cause the remote system to flush | |
208 | all output | |
209 | .B from | |
210 | the remote system | |
211 | .B to | |
212 | the user's terminal. | |
213 | .TP | |
214 | .I ayt | |
215 | .br | |
216 | Sends the | |
217 | .B TELNET AYT | |
218 | (Are You There) | |
219 | sequence, which the remote system may or may not choose to respond to. | |
220 | .TP | |
221 | .I ec | |
222 | .br | |
223 | Sends the | |
224 | .B TELNET EC | |
225 | (Erase Character) | |
226 | sequence, which should cause the remote system to erase the last character | |
227 | entered. | |
228 | .TP | |
229 | .I el | |
230 | .br | |
231 | Sends the | |
232 | .B TELNET EL | |
233 | (Erase Line) | |
234 | sequence, which should cause the remote system to erase the line currently | |
235 | being entered. | |
236 | .TP | |
237 | .I ga | |
238 | .br | |
239 | Sends the | |
240 | .B TELNET GA | |
241 | (Go Ahead) | |
242 | sequence, which likely has no significance to the remote system. | |
243 | .TP | |
244 | .I nop | |
245 | .br | |
246 | Sends the | |
247 | .B TELNET NOP | |
248 | (No OPeration) | |
249 | sequence. | |
250 | .TP | |
251 | .I ? | |
252 | .br | |
253 | Prints out help information for the | |
254 | .B send | |
255 | command. | |
256 | .RE | |
257 | .TP | |
258 | .B set \fIargument value\fP | |
259 | .br | |
260 | Set any one of a number of | |
261 | .I telnet | |
262 | variables to a specific value. | |
263 | The special value \*(lqoff\*(rq turns off the function associated with | |
264 | the variable. | |
265 | The variables which may be specified are: | |
266 | .RS | |
267 | .TP | |
268 | .I echo | |
269 | .br | |
270 | This is the value (initially \*(lq^E\*(rq) which, when in | |
271 | \*(lqline by line\*(rq mode, toggles between doing local echoing | |
272 | of entered characters (for normal processing), and suppressing | |
273 | echoing of entered characters (for entering, say, a password). | |
274 | .TP | |
275 | .I escape | |
276 | .br | |
277 | This is the | |
278 | .I telnet | |
279 | escape character (initially \*(lq^[\*(rq) which causes entry | |
280 | into | |
281 | .I telnet | |
282 | command mode (when connected to a remote system). | |
283 | .TP | |
284 | .I interrupt | |
285 | .br | |
286 | If | |
287 | .I telnet | |
288 | is in | |
289 | .I localchars | |
290 | mode (see | |
291 | .B toggle | |
292 | .I localchars | |
293 | below) | |
294 | and the | |
295 | .I interrupt | |
296 | character is typed, a | |
297 | .B TELNET IP | |
298 | sequence (see | |
299 | .B send | |
300 | .I ip | |
301 | above) | |
302 | is sent to the remote host. | |
303 | The initial value for the interrupt character is taken to be | |
304 | the terminal's | |
305 | .B intr | |
306 | character. | |
307 | .TP | |
308 | .I quit | |
309 | .br | |
310 | If | |
311 | .I telnet | |
312 | is in | |
313 | .I localchars | |
314 | mode (see | |
315 | .B toggle | |
316 | .I localchars | |
317 | below) | |
318 | and the | |
319 | .I quit | |
320 | character is typed, a | |
321 | .B TELNET BRK | |
322 | sequence (see | |
323 | .B send | |
324 | .I brk | |
325 | above) | |
326 | is sent to the remote host. | |
327 | The initial value for the quit character is taken to be | |
328 | the terminal's | |
329 | .B quit | |
330 | character. | |
331 | .TP | |
332 | .I flushoutput | |
333 | .br | |
334 | If | |
335 | .I telnet | |
336 | is in | |
337 | .I localchars | |
338 | mode (see | |
339 | .B toggle | |
340 | .I localchars | |
341 | below) | |
342 | and the | |
343 | .I flushoutput | |
344 | character is typed, a | |
345 | .B TELNET AO | |
346 | sequence (see | |
347 | .B send | |
348 | .I ao | |
349 | above) | |
350 | is sent to the remote host. | |
351 | The initial value for the flush character is taken to be | |
352 | the terminal's | |
353 | .B flush | |
354 | character. | |
355 | .TP | |
356 | .I erase | |
357 | .br | |
358 | If | |
359 | .I telnet | |
360 | is in | |
361 | .I localchars | |
362 | mode (see | |
363 | .B toggle | |
364 | .I localchars | |
365 | below), | |
366 | .B and | |
367 | if | |
368 | .I telnet | |
369 | is operating in \*(lqcharacter at a time\*(rq mode, then when this | |
370 | character is typed, a | |
371 | .B TELNET EC | |
372 | sequence (see | |
373 | .B send | |
374 | .I ec | |
375 | above) | |
376 | is sent to the remote system. | |
377 | The initial value for the erase character is taken to be | |
378 | the terminal's | |
379 | .B erase | |
380 | character. | |
381 | .TP | |
382 | .I kill | |
383 | .br | |
384 | If | |
385 | .I telnet | |
386 | is in | |
387 | .I localchars | |
388 | mode (see | |
389 | .B toggle | |
390 | .I localchars | |
391 | below), | |
392 | .B and | |
393 | if | |
394 | .I telnet | |
395 | is operating in \*(lqcharacter at a time\*(rq mode, then when this | |
396 | character is typed, a | |
397 | .B TELNET EL | |
398 | sequence (see | |
399 | .B send | |
400 | .I el | |
401 | above) | |
402 | is sent to the remote system. | |
403 | The initial value for the kill character is taken to be | |
404 | the terminal's | |
405 | .B kill | |
406 | character. | |
407 | .TP | |
408 | .I eof | |
409 | .br | |
410 | If | |
411 | .I telnet | |
412 | is operating in \*(lqline by line\*(rq mode, entering this character | |
413 | as the first character on a line will cause this character to be | |
414 | sent to the remote system. | |
415 | The initial value of the eof character is taken to be the terminal's | |
416 | .B eof | |
417 | character. | |
418 | .RE | |
419 | .TP | |
420 | .B toggle \fIarguments...\fP | |
421 | .br | |
422 | Toggle (between | |
423 | TRUE | |
424 | and | |
425 | FALSE) | |
426 | various flags that control how | |
427 | .I telnet | |
428 | responds to events. | |
429 | More than one argument may be specified. | |
430 | Valid arguments are: | |
431 | .RS | |
432 | .TP | |
433 | .I localchars | |
434 | .br | |
435 | If this is | |
436 | TRUE, | |
437 | then the | |
438 | .IR flush , | |
439 | .IR interrupt , | |
440 | .IR quit , | |
441 | .IR erase , | |
442 | and | |
443 | .I kill | |
444 | characters (see | |
445 | .B set | |
446 | above) are recognized locally, and transformed into (hopefully) appropriate | |
447 | .B TELNET | |
448 | control sequences | |
449 | (respectively | |
450 | .IR ao , | |
451 | .IR ip , | |
452 | .IR brk , | |
453 | .IR ec , | |
454 | and | |
455 | .IR el ; | |
456 | see | |
457 | .B send | |
458 | above). | |
459 | The initial value for this toggle is TRUE in \*(lqline by line\*(rq mode, | |
460 | and FALSE in \*(lqcharacter at a time\*(rq mode. | |
461 | .TP | |
462 | .I autosynch | |
463 | If | |
464 | .I autosynch | |
465 | and | |
466 | .I localsigs | |
467 | are both | |
468 | TRUE, | |
469 | then when either the | |
470 | .I intr | |
471 | or | |
472 | .I quit | |
473 | characters is typed (see | |
474 | .B set | |
475 | above for descriptions of the | |
476 | .I intr | |
477 | and | |
478 | .I quit | |
479 | characters), the resulting | |
480 | .B TELNET | |
481 | sequence sent is followed by the | |
482 | .B TELNET SYNCH | |
483 | sequence. | |
484 | This procedure | |
485 | .B should | |
486 | cause the remote system to begin throwing away all previously | |
487 | typed input until both of the | |
488 | .B TELNET | |
489 | sequences have been read and acted upon. | |
490 | The initial value of this toggle is FALSE. | |
491 | .TP | |
492 | .I autoflush | |
493 | .br | |
494 | If | |
495 | .I autoflush | |
496 | and | |
497 | .I localchars | |
498 | are both | |
499 | TRUE, | |
500 | then when the | |
501 | .IR ao , | |
502 | .IR intr , | |
503 | or | |
504 | .I quit | |
505 | characters are recognized (and transformed into | |
506 | .B TELNET | |
507 | sequences; see | |
508 | .B set | |
509 | above for details), | |
510 | .I telnet | |
511 | refuses to display any data on the user's terminal | |
512 | until the remote system acknowledges (via a | |
513 | .B TELNET | |
514 | .I Timing Mark | |
515 | option) | |
516 | that it has processed those | |
517 | .B TELNET | |
518 | sequences. | |
519 | The initial value for this toggle is TRUE if the terminal user had not | |
520 | done an "stty noflsh", otherwise FALSE (see | |
521 | .IR stty(1)). | |
522 | .TP | |
523 | .I crmod | |
524 | .br | |
525 | Toggle carriage return mode. | |
526 | When this mode is enabled, most carriage return characters received from | |
527 | the remote host will be mapped into a carriage return followed by | |
528 | a line feed. | |
529 | This mode does not affect those characters typed by the user, only | |
530 | those received from the remote host. | |
531 | This mode is not very useful unless the remote host | |
532 | only sends carriage return, but never line feed. | |
533 | The initial value for this toggle is FALSE. | |
534 | .TP | |
535 | .I debug | |
536 | .br | |
537 | Toggles socket level debugging (useful only to the | |
538 | .IR super user ). | |
539 | The initial value for this toggle is FALSE. | |
540 | .TP | |
541 | .I options | |
542 | .br | |
543 | Toggles the display of some internal | |
544 | .I telnet | |
545 | protocol processing (having to do with | |
546 | .B TELNET | |
547 | options). | |
548 | The initial value for this toggle is FALSE. | |
549 | .TP | |
550 | .I netdata | |
551 | .br | |
552 | Toggles the display of all network data (in hexadecimal format). | |
553 | The initial value for this toggle is FALSE. | |
554 | .TP | |
555 | .I ? | |
556 | .br | |
557 | Displays the legal | |
558 | .B toggle | |
559 | commands. | |
560 | .RE | |
24854a1c | 561 | .SH BUGS |
5c2bded5 GM |
562 | .PP |
563 | There is no adequate way for dealing with flow control. | |
564 | .PP | |
565 | On some remote systems, echo has to be turned off manually when in | |
566 | \*(lqline by line\*(rq mode. | |
567 | .PP | |
568 | There is enough settable state to justify a | |
569 | .RI . telnetrc | |
570 | file. | |
571 | .PP | |
572 | No capability for a | |
573 | .RI . telnetrc | |
574 | file is provided. | |
575 | .PP | |
576 | In \*(lqline by line\*(rq mode, the terminal's | |
577 | .I eof | |
578 | character is only recognized (and sent to the remote system) | |
579 | when it is the first character on a line. |