Annotation of src/usr.bin/telnet/telnet.1, Revision 1.5
1.5 ! deraadt 1: .\" $OpenBSD: telnet.1,v 1.4 1996/12/10 09:06:36 deraadt Exp $
1.2 niklas 2: .\" $NetBSD: telnet.1,v 1.5 1996/02/28 21:04:12 thorpej Exp $
3: .\"
1.1 deraadt 4: .\" Copyright (c) 1983, 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
15: .\" 3. All advertising materials mentioning features or use of this software
16: .\" must display the following acknowledgement:
17: .\" This product includes software developed by the University of
18: .\" California, Berkeley and its contributors.
19: .\" 4. Neither the name of the University nor the names of its contributors
20: .\" may be used to endorse or promote products derived from this software
21: .\" without specific prior written permission.
22: .\"
23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: .\" SUCH DAMAGE.
34: .\"
35: .\" from: @(#)telnet.1 8.4 (Berkeley) 2/3/94
36: .\"
37: .Dd February 3, 1994
38: .Dt TELNET 1
39: .Os BSD 4.2
40: .Sh NAME
41: .Nm telnet
42: .Nd user interface to the
43: .Tn TELNET
44: protocol
45: .Sh SYNOPSIS
46: .Nm telnet
47: .Op Fl 8
48: .Op Fl E
49: .Op Fl F
50: .Op Fl K
51: .Op Fl L
52: .Op Fl S Ar tos
53: .Op Fl X Ar authtype
54: .Op Fl a
1.3 niklas 55: .Op Fl b Ar hostalias
1.1 deraadt 56: .Op Fl c
57: .Op Fl d
58: .Op Fl e Ar escapechar
59: .Op Fl f
60: .Op Fl k Ar realm
61: .Op Fl l Ar user
62: .Op Fl n Ar tracefile
63: .Op Fl r
64: .Op Fl x
65: .Oo
66: .Ar host
67: .Op port
68: .Oc
69: .Sh DESCRIPTION
70: The
71: .Nm telnet
72: command
73: is used to communicate with another host using the
74: .Tn TELNET
75: protocol.
76: If
77: .Nm telnet
78: is invoked without the
79: .Ar host
80: argument, it enters command mode,
81: indicated by its prompt
82: .Pq Nm telnet\&> .
83: In this mode, it accepts and executes the commands listed below.
84: If it is invoked with arguments, it performs an
85: .Ic open
86: command with those arguments.
87: .Pp
88: Options:
89: .Bl -tag -width indent
90: .It Fl 8
91: Specifies an 8-bit data path. This causes an attempt to
92: negotiate the
93: .Dv TELNET BINARY
94: option on both input and output.
95: .It Fl E
96: Stops any character from being recognized as an escape character.
97: .It Fl F
98: If Kerberos V5 authentication is being used, the
99: .Fl F
100: option allows the local credentials to be forwarded
101: to the remote system, including any credentials that
102: have already been forwarded into the local environment.
103: .It Fl K
104: Specifies no automatic login to the remote system.
105: .It Fl L
106: Specifies an 8-bit data path on output. This causes the
107: BINARY option to be negotiated on output.
108: .It Fl S Ar tos
109: Sets the IP type-of-service (TOS) option for the telnet
110: connection to the value
111: .Ar tos,
112: which can be a numeric TOS value
113: or, on systems that support it, a symbolic
114: TOS name found in the /etc/iptos file.
115: .It Fl X Ar atype
116: Disables the
117: .Ar atype
118: type of authentication.
119: .It Fl a
120: Attempt automatic login.
121: Currently, this sends the user name via the
122: .Ev USER
123: variable
124: of the
125: .Ev ENVIRON
126: option if supported by the remote system.
127: The name used is that of the current user as returned by
128: .Xr getlogin 2
129: if it agrees with the current user ID,
130: otherwise it is the name associated with the user ID.
1.3 niklas 131: .It Fl b Ar hostalias
132: Uses
133: .Xr bind 2
134: on the local socket to bind it to an aliased address (See
135: .Xr ifconfig 8
136: and the \*(Lqalias\*(Rq specifier) or to the address of
137: another interface than the one naturally chosen by
138: .Xr connect 2 .
139: This can be useful when connecting to services which uses IP addresses
140: for authentication and reconfiguration of the server is undesirable (or
141: impossible).
1.1 deraadt 142: .It Fl c
143: Disables the reading of the user's
144: .Pa \&.telnetrc
145: file. (See the
146: .Ic toggle skiprc
147: command on this man page.)
148: .It Fl d
149: Sets the initial value of the
150: .Ic debug
151: toggle to
152: .Dv TRUE
153: .It Fl e Ar escape char
154: Sets the initial
155: .Nm
156: .Nm telnet
157: escape character to
158: .Ar escape char.
159: If
160: .Ar escape char
161: is omitted, then
162: there will be no escape character.
163: .It Fl f
164: If Kerberos V5 authentication is being used, the
165: .Fl f
166: option allows the local credentials to be forwarded to the remote system.
167: .It Fl k Ar realm
168: If Kerberos authentication is being used, the
169: .Fl k
170: option requests that telnet obtain tickets for the remote host in
171: realm realm instead of the remote host's realm, as determined
172: by
173: .Xr krb_realmofhost 3 .
174: .It Fl l Ar user
175: When connecting to the remote system, if the remote system
176: understands the
177: .Ev ENVIRON
178: option, then
179: .Ar user
180: will be sent to the remote system as the value for the variable USER.
181: This option implies the
182: .Fl a
183: option.
184: This option may also be used with the
185: .Ic open
186: command.
187: .It Fl n Ar tracefile
188: Opens
189: .Ar tracefile
190: for recording trace information.
191: See the
192: .Ic set tracefile
193: command below.
194: .It Fl r
195: Specifies a user interface similar to
196: .Xr rlogin 1 .
197: In this
198: mode, the escape character is set to the tilde (~) character,
199: unless modified by the -e option.
200: .It Fl x
201: Turns on encryption of the data stream if possible. This
202: option is not available outside of the United States and
203: Canada.
204: .It Ar host
205: Indicates the official name, an alias, or the Internet address
206: of a remote host.
207: .It Ar port
208: Indicates a port number (address of an application). If a number is
209: not specified, the default
210: .Nm telnet
211: port is used.
212: .El
213: .Pp
214: When in rlogin mode, a line of the form ~. disconnects from the
215: remote host; ~ is the telnet escape character.
216: Similarly, the line ~^Z suspends the telnet session.
217: The line ~^] escapes to the normal telnet escape prompt.
218: .Pp
219: Once a connection has been opened,
220: .Nm telnet
221: will attempt to enable the
222: .Dv TELNET LINEMODE
223: option.
224: If this fails, then
225: .Nm telnet
226: will revert to one of two input modes:
227: either \*(Lqcharacter at a time\*(Rq
228: or \*(Lqold line by line\*(Rq
229: depending on what the remote system supports.
230: .Pp
231: When
232: .Dv LINEMODE
233: is enabled, character processing is done on the
234: local system, under the control of the remote system. When input
235: editing or character echoing is to be disabled, the remote system
236: will relay that information. The remote system will also relay
237: changes to any special characters that happen on the remote
238: system, so that they can take effect on the local system.
239: .Pp
240: In \*(Lqcharacter at a time\*(Rq mode, most
241: text typed is immediately sent to the remote host for processing.
242: .Pp
243: In \*(Lqold line by line\*(Rq mode, all text is echoed locally,
244: and (normally) only completed lines are sent to the remote host.
245: The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used
246: to turn off and on the local echo
247: (this would mostly be used to enter passwords
248: without the password being echoed).
249: .Pp
250: If the
251: .Dv LINEMODE
252: option is enabled, or if the
253: .Ic localchars
254: toggle is
255: .Dv TRUE
256: (the default for \*(Lqold line by line\*(Lq; see below),
257: the user's
258: .Ic quit ,
259: .Ic intr ,
260: and
261: .Ic flush
262: characters are trapped locally, and sent as
263: .Tn TELNET
264: protocol sequences to the remote side.
265: If
266: .Dv LINEMODE
267: has ever been enabled, then the user's
268: .Ic susp
269: and
270: .Ic eof
271: are also sent as
272: .Tn TELNET
273: protocol sequences,
274: and
275: .Ic quit
276: is sent as a
277: .Dv TELNET ABORT
278: instead of
279: .Dv BREAK
280: There are options (see
281: .Ic toggle
282: .Ic autoflush
283: and
284: .Ic toggle
285: .Ic autosynch
286: below)
287: which cause this action to flush subsequent output to the terminal
288: (until the remote host acknowledges the
289: .Tn TELNET
290: sequence) and flush previous terminal input
291: (in the case of
292: .Ic quit
293: and
294: .Ic intr ) .
295: .Pp
296: While connected to a remote host,
297: .Nm telnet
298: command mode may be entered by typing the
299: .Nm telnet
300: \*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq).
301: When in command mode, the normal terminal editing conventions are available.
302: .Pp
303: The following
304: .Nm telnet
305: commands are available.
306: Only enough of each command to uniquely identify it need be typed
307: (this is also true for arguments to the
308: .Ic mode ,
309: .Ic set ,
310: .Ic toggle ,
311: .Ic unset ,
312: .Ic slc ,
313: .Ic environ ,
314: and
315: .Ic display
316: commands).
317: .Pp
318: .Bl -tag -width "mode type"
319: .It Ic auth Ar argument ...
320: The auth command manipulates the information sent through the
321: .Dv TELNET AUTHENTICATE
322: option. Valid arguments for the
323: auth command are as follows:
324: .Bl -tag -width "disable type"
325: .It Ic disable Ar type
326: Disables the specified type of authentication. To
327: obtain a list of available types, use the
328: .Ic auth disable \&?
329: command.
330: .It Ic enable Ar type
331: Enables the specified type of authentication. To
332: obtain a list of available types, use the
333: .Ic auth enable \&?
334: command.
335: .It Ic status
336: Lists the current status of the various types of
337: authentication.
338: .El
339: .It Ic close
340: Close a
341: .Tn TELNET
342: session and return to command mode.
343: .It Ic display Ar argument ...
344: Displays all, or some, of the
345: .Ic set
346: and
347: .Ic toggle
348: values (see below).
349: .It Ic encrypt Ar argument ...
350: The encrypt command manipulates the information sent through the
351: .Dv TELNET ENCRYPT
352: option.
353: .Pp
354: Note: Because of export controls, the
355: .Dv TELNET ENCRYPT
356: option is not supported outside of the United States and Canada.
357: .Pp
358: Valid arguments for the encrypt command are as follows:
359: .Bl -tag -width Ar
360: .It Ic disable Ar type Ic [input|output]
361: Disables the specified type of encryption. If you
362: omit the input and output, both input and output
363: are disabled. To obtain a list of available
364: types, use the
365: .Ic encrypt disable \&?
366: command.
367: .It Ic enable Ar type Ic [input|output]
368: Enables the specified type of encryption. If you
369: omit input and output, both input and output are
370: enabled. To obtain a list of available types, use the
371: .Ic encrypt enable \&?
372: command.
373: .It Ic input
374: This is the same as the
375: .Ic encrypt start input
376: command.
377: .It Ic -input
378: This is the same as the
379: .Ic encrypt stop input
380: command.
381: .It Ic output
382: This is the same as the
383: .Ic encrypt start output
384: command.
385: .It Ic -output
386: This is the same as the
387: .Ic encrypt stop output
388: command.
389: .It Ic start Ic [input|output]
390: Attempts to start encryption. If you omit
391: .Ic input
392: and
393: .Ic output,
394: both input and output are enabled. To
395: obtain a list of available types, use the
396: .Ic encrypt enable \&?
397: command.
398: .It Ic status
399: Lists the current status of encryption.
400: .It Ic stop Ic [input|output]
401: Stops encryption. If you omit input and output,
402: encryption is on both input and output.
403: .It Ic type Ar type
404: Sets the default type of encryption to be used
405: with later
406: .Ic encrypt start
407: or
408: .Ic encrypt stop
409: commands.
410: .El
411: .It Ic environ Ar arguments...
412: The
413: .Ic environ
414: command is used to manipulate the
415: the variables that my be sent through the
416: .Dv TELNET ENVIRON
417: option.
418: The initial set of variables is taken from the users
419: environment, with only the
420: .Ev DISPLAY
421: and
422: .Ev PRINTER
423: variables being exported by default.
424: The
425: .Ev USER
426: variable is also exported if the
427: .Fl a
428: or
429: .Fl l
430: options are used.
431: .br
432: Valid arguments for the
433: .Ic environ
434: command are:
435: .Bl -tag -width Fl
436: .It Ic define Ar variable value
437: Define the variable
438: .Ar variable
439: to have a value of
440: .Ar value.
441: Any variables defined by this command are automatically exported.
442: The
443: .Ar value
444: may be enclosed in single or double quotes so
445: that tabs and spaces may be included.
446: .It Ic undefine Ar variable
447: Remove
448: .Ar variable
449: from the list of environment variables.
450: .It Ic export Ar variable
451: Mark the variable
452: .Ar variable
453: to be exported to the remote side.
454: .It Ic unexport Ar variable
455: Mark the variable
456: .Ar variable
457: to not be exported unless
458: explicitly asked for by the remote side.
459: .It Ic list
460: List the current set of environment variables.
461: Those marked with a
462: .Cm *
463: will be sent automatically,
464: other variables will only be sent if explicitly requested.
465: .It Ic \&?
466: Prints out help information for the
467: .Ic environ
468: command.
469: .El
470: .It Ic logout
471: Sends the
472: .Dv TELNET LOGOUT
473: option to the remote side.
474: This command is similar to a
475: .Ic close
476: command; however, if the remote side does not support the
477: .Dv LOGOUT
478: option, nothing happens.
479: If, however, the remote side does support the
480: .Dv LOGOUT
481: option, this command should cause the remote side to close the
482: .Tn TELNET
483: connection.
484: If the remote side also supports the concept of
485: suspending a user's session for later reattachment,
486: the logout argument indicates that you
487: should terminate the session immediately.
488: .It Ic mode Ar type
489: .Ar Type
490: is one of several options, depending on the state of the
491: .Tn TELNET
492: session.
493: The remote host is asked for permission to go into the requested mode.
494: If the remote host is capable of entering that mode, the requested
495: mode will be entered.
496: .Bl -tag -width Ar
497: .It Ic character
498: Disable the
499: .Dv TELNET LINEMODE
500: option, or, if the remote side does not understand the
501: .Dv LINEMODE
502: option, then enter \*(Lqcharacter at a time\*(Lq mode.
503: .It Ic line
504: Enable the
505: .Dv TELNET LINEMODE
506: option, or, if the remote side does not understand the
507: .Dv LINEMODE
508: option, then attempt to enter \*(Lqold-line-by-line\*(Lq mode.
509: .It Ic isig Pq Ic \-isig
510: Attempt to enable (disable) the
511: .Dv TRAPSIG
512: mode of the
513: .Dv LINEMODE
514: option.
515: This requires that the
516: .Dv LINEMODE
517: option be enabled.
518: .It Ic edit Pq Ic \-edit
519: Attempt to enable (disable) the
520: .Dv EDIT
521: mode of the
522: .Dv LINEMODE
523: option.
524: This requires that the
525: .Dv LINEMODE
526: option be enabled.
527: .It Ic softtabs Pq Ic \-softtabs
528: Attempt to enable (disable) the
529: .Dv SOFT_TAB
530: mode of the
531: .Dv LINEMODE
532: option.
533: This requires that the
534: .Dv LINEMODE
535: option be enabled.
536: .It Ic litecho Pq Ic \-litecho
537: Attempt to enable (disable) the
538: .Dv LIT_ECHO
539: mode of the
540: .Dv LINEMODE
541: option.
542: This requires that the
543: .Dv LINEMODE
544: option be enabled.
545: .It Ic \&?
546: Prints out help information for the
547: .Ic mode
548: command.
549: .El
550: .It Xo
551: .Ic open Ar host
1.5 ! deraadt 552: .Op Fl l Ar user
! 553: .Oo Op Fl
1.1 deraadt 554: .Ar port Oc
555: .Xc
556: Open a connection to the named host.
557: If no port number
558: is specified,
559: .Nm telnet
560: will attempt to contact a
561: .Tn TELNET
562: server at the default port.
563: The host specification may be either a host name (see
564: .Xr hosts 5 )
565: or an Internet address specified in the \*(Lqdot notation\*(Rq (see
566: .Xr inet 3 ) .
567: The
1.5 ! deraadt 568: .Fl l
1.1 deraadt 569: option may be used to specify the user name
570: to be passed to the remote system via the
571: .Ev ENVIRON
572: option.
573: When connecting to a non-standard port,
574: .Nm telnet
575: omits any automatic initiation of
576: .Tn TELNET
577: options. When the port number is preceded by a minus sign,
578: the initial option negotiation is done.
579: After establishing a connection, the file
580: .Pa \&.telnetrc
581: in the
582: users home directory is opened. Lines beginning with a # are
583: comment lines. Blank lines are ignored. Lines that begin
584: without white space are the start of a machine entry. The
585: first thing on the line is the name of the machine that is
586: being connected to. The rest of the line, and successive
587: lines that begin with white space are assumed to be
588: .Nm telnet
589: commands and are processed as if they had been typed
590: in manually to the
591: .Nm telnet
592: command prompt.
593: .It Ic quit
594: Close any open
595: .Tn TELNET
596: session and exit
597: .Nm telnet .
598: An end of file (in command mode) will also close a session and exit.
599: .It Ic send Ar arguments
600: Sends one or more special character sequences to the remote host.
601: The following are the arguments which may be specified
602: (more than one argument may be specified at a time):
603: .Pp
604: .Bl -tag -width escape
605: .It Ic abort
606: Sends the
607: .Dv TELNET ABORT
608: (Abort
609: processes)
610: sequence.
611: .It Ic ao
612: Sends the
613: .Dv TELNET AO
614: (Abort Output) sequence, which should cause the remote system to flush
615: all output
616: .Em from
617: the remote system
618: .Em to
619: the user's terminal.
620: .It Ic ayt
621: Sends the
622: .Dv TELNET AYT
623: (Are You There)
624: sequence, to which the remote system may or may not choose to respond.
625: .It Ic brk
626: Sends the
627: .Dv TELNET BRK
628: (Break) sequence, which may have significance to the remote
629: system.
630: .It Ic ec
631: Sends the
632: .Dv TELNET EC
633: (Erase Character)
634: sequence, which should cause the remote system to erase the last character
635: entered.
636: .It Ic el
637: Sends the
638: .Dv TELNET EL
639: (Erase Line)
640: sequence, which should cause the remote system to erase the line currently
641: being entered.
642: .It Ic eof
643: Sends the
644: .Dv TELNET EOF
645: (End Of File)
646: sequence.
647: .It Ic eor
648: Sends the
649: .Dv TELNET EOR
650: (End of Record)
651: sequence.
652: .It Ic escape
653: Sends the current
654: .Nm telnet
655: escape character (initially \*(Lq^\*(Rq).
656: .It Ic ga
657: Sends the
658: .Dv TELNET GA
659: (Go Ahead)
660: sequence, which likely has no significance to the remote system.
661: .It Ic getstatus
662: If the remote side supports the
663: .Dv TELNET STATUS
664: command,
665: .Ic getstatus
666: will send the subnegotiation to request that the server send
667: its current option status.
668: .It Ic ip
669: Sends the
670: .Dv TELNET IP
671: (Interrupt Process) sequence, which should cause the remote
672: system to abort the currently running process.
673: .It Ic nop
674: Sends the
675: .Dv TELNET NOP
676: (No OPeration)
677: sequence.
678: .It Ic susp
679: Sends the
680: .Dv TELNET SUSP
681: (SUSPend process)
682: sequence.
683: .It Ic synch
684: Sends the
685: .Dv TELNET SYNCH
686: sequence.
687: This sequence causes the remote system to discard all previously typed
688: (but not yet read) input.
689: This sequence is sent as
690: .Tn TCP
691: urgent
692: data (and may not work if the remote system is a
693: .Bx 4.2
694: system -- if
695: it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
696: .It Ic do Ar cmd
697: .It Ic dont Ar cmd
698: .It Ic will Ar cmd
699: .It Ic wont Ar cmd
700: Sends the
701: .Dv TELNET DO
702: .Ar cmd
703: sequence.
704: .Ar Cmd
705: can be either a decimal number between 0 and 255,
706: or a symbolic name for a specific
707: .Dv TELNET
708: command.
709: .Ar Cmd
710: can also be either
711: .Ic help
712: or
713: .Ic \&?
714: to print out help information, including
715: a list of known symbolic names.
716: .It Ic \&?
717: Prints out help information for the
718: .Ic send
719: command.
720: .El
721: .It Ic set Ar argument value
722: .It Ic unset Ar argument value
723: The
724: .Ic set
725: command will set any one of a number of
726: .Nm telnet
727: variables to a specific value or to
728: .Dv TRUE .
729: The special value
730: .Ic off
731: turns off the function associated with
732: the variable, this is equivalent to using the
733: .Ic unset
734: command.
735: The
736: .Ic unset
737: command will disable or set to
738: .Dv FALSE
739: any of the specified functions.
740: The values of variables may be interrogated with the
741: .Ic display
742: command.
743: The variables which may be set or unset, but not toggled, are
744: listed here. In addition, any of the variables for the
745: .Ic toggle
746: command may be explicitly set or unset using
747: the
748: .Ic set
749: and
750: .Ic unset
751: commands.
752: .Bl -tag -width escape
753: .It Ic ayt
754: If
755: .Tn TELNET
756: is in localchars mode, or
757: .Dv LINEMODE
758: is enabled, and the status character is typed, a
759: .Dv TELNET AYT
760: sequence (see
761: .Ic send ayt
762: preceding) is sent to the
763: remote host. The initial value for the "Are You There"
764: character is the terminal's status character.
765: .It Ic echo
766: This is the value (initially \*(Lq^E\*(Rq) which, when in
767: \*(Lqline by line\*(Rq mode, toggles between doing local echoing
768: of entered characters (for normal processing), and suppressing
769: echoing of entered characters (for entering, say, a password).
770: .It Ic eof
771: If
772: .Nm telnet
773: is operating in
774: .Dv LINEMODE
775: or \*(Lqold line by line\*(Rq mode, entering this character
776: as the first character on a line will cause this character to be
777: sent to the remote system.
778: The initial value of the eof character is taken to be the terminal's
779: .Ic eof
780: character.
781: .It Ic erase
782: If
783: .Nm telnet
784: is in
785: .Ic localchars
786: mode (see
787: .Ic toggle
788: .Ic localchars
789: below),
790: .Sy and
791: if
792: .Nm telnet
793: is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
794: character is typed, a
795: .Dv TELNET EC
796: sequence (see
797: .Ic send
798: .Ic ec
799: above)
800: is sent to the remote system.
801: The initial value for the erase character is taken to be
802: the terminal's
803: .Ic erase
804: character.
805: .It Ic escape
806: This is the
807: .Nm telnet
808: escape character (initially \*(Lq^[\*(Rq) which causes entry
809: into
810: .Nm telnet
811: command mode (when connected to a remote system).
812: .It Ic flushoutput
813: If
814: .Nm telnet
815: is in
816: .Ic localchars
817: mode (see
818: .Ic toggle
819: .Ic localchars
820: below)
821: and the
822: .Ic flushoutput
823: character is typed, a
824: .Dv TELNET AO
825: sequence (see
826: .Ic send
827: .Ic ao
828: above)
829: is sent to the remote host.
830: The initial value for the flush character is taken to be
831: the terminal's
832: .Ic flush
833: character.
834: .It Ic forw1
835: .It Ic forw2
836: If
837: .Tn TELNET
838: is operating in
839: .Dv LINEMODE ,
840: these are the
841: characters that, when typed, cause partial lines to be
842: forwarded to the remote system. The initial value for
843: the forwarding characters are taken from the terminal's
844: eol and eol2 characters.
845: .It Ic interrupt
846: If
847: .Nm telnet
848: is in
849: .Ic localchars
850: mode (see
851: .Ic toggle
852: .Ic localchars
853: below)
854: and the
855: .Ic interrupt
856: character is typed, a
857: .Dv TELNET IP
858: sequence (see
859: .Ic send
860: .Ic ip
861: above)
862: is sent to the remote host.
863: The initial value for the interrupt character is taken to be
864: the terminal's
865: .Ic intr
866: character.
867: .It Ic kill
868: If
869: .Nm telnet
870: is in
871: .Ic localchars
872: mode (see
873: .Ic toggle
874: .Ic localchars
875: below),
876: .Ic and
877: if
878: .Nm telnet
879: is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
880: character is typed, a
881: .Dv TELNET EL
882: sequence (see
883: .Ic send
884: .Ic el
885: above)
886: is sent to the remote system.
887: The initial value for the kill character is taken to be
888: the terminal's
889: .Ic kill
890: character.
891: .It Ic lnext
892: If
893: .Nm telnet
894: is operating in
895: .Dv LINEMODE
896: or \*(Lqold line by line\*(Lq mode, then this character is taken to
897: be the terminal's
898: .Ic lnext
899: character.
900: The initial value for the lnext character is taken to be
901: the terminal's
902: .Ic lnext
903: character.
904: .It Ic quit
905: If
906: .Nm telnet
907: is in
908: .Ic localchars
909: mode (see
910: .Ic toggle
911: .Ic localchars
912: below)
913: and the
914: .Ic quit
915: character is typed, a
916: .Dv TELNET BRK
917: sequence (see
918: .Ic send
919: .Ic brk
920: above)
921: is sent to the remote host.
922: The initial value for the quit character is taken to be
923: the terminal's
924: .Ic quit
925: character.
926: .It Ic reprint
927: If
928: .Nm telnet
929: is operating in
930: .Dv LINEMODE
931: or \*(Lqold line by line\*(Lq mode, then this character is taken to
932: be the terminal's
933: .Ic reprint
934: character.
935: The initial value for the reprint character is taken to be
936: the terminal's
937: .Ic reprint
938: character.
939: .It Ic rlogin
940: This is the rlogin escape character.
941: If set, the normal
942: .Tn TELNET
943: escape character is ignored unless it is
944: preceded by this character at the beginning of a line.
945: This character, at the beginning of a line followed by
946: a "." closes the connection; when followed by a ^Z it
1.5 ! deraadt 947: suspends the
! 948: .Nm telnet
! 949: command. The initial state is to
1.1 deraadt 950: disable the rlogin escape character.
951: .It Ic start
952: If the
953: .Dv TELNET TOGGLE-FLOW-CONTROL
954: option has been enabled,
955: then this character is taken to
956: be the terminal's
957: .Ic start
958: character.
1.5 ! deraadt 959: The initial value for the start character is taken to be
1.1 deraadt 960: the terminal's
961: .Ic start
962: character.
963: .It Ic stop
964: If the
965: .Dv TELNET TOGGLE-FLOW-CONTROL
966: option has been enabled,
967: then this character is taken to
968: be the terminal's
969: .Ic stop
970: character.
1.5 ! deraadt 971: The initial value for the stop character is taken to be
1.1 deraadt 972: the terminal's
973: .Ic stop
974: character.
975: .It Ic susp
976: If
977: .Nm telnet
978: is in
979: .Ic localchars
980: mode, or
981: .Dv LINEMODE
982: is enabled, and the
983: .Ic suspend
984: character is typed, a
985: .Dv TELNET SUSP
986: sequence (see
987: .Ic send
988: .Ic susp
989: above)
990: is sent to the remote host.
991: The initial value for the suspend character is taken to be
992: the terminal's
993: .Ic suspend
994: character.
995: .It Ic tracefile
996: This is the file to which the output, caused by
997: .Ic netdata
998: or
999: .Ic option
1000: tracing being
1001: .Dv TRUE ,
1002: will be written. If it is set to
1003: .Dq Fl ,
1004: then tracing information will be written to standard output (the default).
1005: .It Ic worderase
1006: If
1007: .Nm telnet
1008: is operating in
1009: .Dv LINEMODE
1010: or \*(Lqold line by line\*(Lq mode, then this character is taken to
1011: be the terminal's
1012: .Ic worderase
1013: character.
1014: The initial value for the worderase character is taken to be
1015: the terminal's
1016: .Ic worderase
1017: character.
1018: .It Ic \&?
1019: Displays the legal
1020: .Ic set
1021: .Pq Ic unset
1022: commands.
1023: .El
1024: .It Ic slc Ar state
1025: The
1026: .Ic slc
1027: command (Set Local Characters) is used to set
1.4 deraadt 1028: or change the state of the special
1.1 deraadt 1029: characters when the
1030: .Dv TELNET LINEMODE
1031: option has
1032: been enabled. Special characters are characters that get
1033: mapped to
1034: .Tn TELNET
1035: commands sequences (like
1036: .Ic ip
1037: or
1038: .Ic quit )
1039: or line editing characters (like
1040: .Ic erase
1041: and
1042: .Ic kill ) .
1043: By default, the local special characters are exported.
1044: .Bl -tag -width Fl
1045: .It Ic check
1046: Verify the current settings for the current special characters.
1047: The remote side is requested to send all the current special
1048: character settings, and if there are any discrepancies with
1049: the local side, the local side will switch to the remote value.
1050: .It Ic export
1051: Switch to the local defaults for the special characters. The
1052: local default characters are those of the local terminal at
1053: the time when
1054: .Nm telnet
1055: was started.
1056: .It Ic import
1057: Switch to the remote defaults for the special characters.
1058: The remote default characters are those of the remote system
1059: at the time when the
1060: .Tn TELNET
1061: connection was established.
1062: .It Ic \&?
1063: Prints out help information for the
1064: .Ic slc
1065: command.
1066: .El
1067: .It Ic status
1068: Show the current status of
1069: .Nm telnet .
1070: This includes the peer one is connected to, as well
1071: as the current mode.
1072: .It Ic toggle Ar arguments ...
1073: Toggle (between
1074: .Dv TRUE
1075: and
1076: .Dv FALSE )
1077: various flags that control how
1078: .Nm telnet
1079: responds to events.
1080: These flags may be set explicitly to
1081: .Dv TRUE
1082: or
1083: .Dv FALSE
1084: using the
1085: .Ic set
1086: and
1087: .Ic unset
1088: commands listed above.
1089: More than one argument may be specified.
1090: The state of these flags may be interrogated with the
1091: .Ic display
1092: command.
1093: Valid arguments are:
1094: .Bl -tag -width Ar
1095: .It Ic authdebug
1096: Turns on debugging information for the authentication code.
1097: .It Ic autoflush
1098: If
1099: .Ic autoflush
1100: and
1101: .Ic localchars
1102: are both
1103: .Dv TRUE ,
1104: then when the
1105: .Ic ao ,
1106: or
1107: .Ic quit
1108: characters are recognized (and transformed into
1109: .Tn TELNET
1110: sequences; see
1111: .Ic set
1112: above for details),
1113: .Nm telnet
1114: refuses to display any data on the user's terminal
1115: until the remote system acknowledges (via a
1116: .Dv TELNET TIMING MARK
1117: option)
1118: that it has processed those
1119: .Tn TELNET
1120: sequences.
1121: The initial value for this toggle is
1122: .Dv TRUE
1123: if the terminal user had not
1124: done an "stty noflsh", otherwise
1125: .Dv FALSE
1126: (see
1127: .Xr stty 1 ) .
1128: .It Ic autodecrypt
1129: When the
1130: .Dv TELNET ENCRYPT
1131: option is negotiated, by
1132: default the actual encryption (decryption) of the data
1133: stream does not start automatically. The autoencrypt
1134: (autodecrypt) command states that encryption of the
1135: output (input) stream should be enabled as soon as
1136: possible.
1137: .Pp
1138: Note: Because of export controls, the
1139: .Dv TELNET ENCRYPT
1140: option is not supported outside the United States and Canada.
1141: .It Ic autologin
1142: If the remote side supports the
1143: .Dv TELNET AUTHENTICATION
1144: option
1145: .Tn TELNET
1146: attempts to use it to perform automatic authentication. If the
1147: .Dv AUTHENTICATION
1148: option is not supported, the user's login
1149: name are propagated through the
1150: .Dv TELNET ENVIRON
1151: option.
1152: This command is the same as specifying
1153: .Ar a
1154: option on the
1155: .Ic open
1156: command.
1157: .It Ic autosynch
1158: If
1159: .Ic autosynch
1160: and
1161: .Ic localchars
1162: are both
1163: .Dv TRUE ,
1164: then when either the
1165: .Ic intr
1166: or
1167: .Ic quit
1168: characters is typed (see
1169: .Ic set
1170: above for descriptions of the
1171: .Ic intr
1172: and
1173: .Ic quit
1174: characters), the resulting
1175: .Tn TELNET
1176: sequence sent is followed by the
1177: .Dv TELNET SYNCH
1178: sequence.
1179: This procedure
1180: .Ic should
1181: cause the remote system to begin throwing away all previously
1182: typed input until both of the
1183: .Tn TELNET
1184: sequences have been read and acted upon.
1185: The initial value of this toggle is
1186: .Dv FALSE .
1187: .It Ic binary
1188: Enable or disable the
1189: .Dv TELNET BINARY
1190: option on both input and output.
1191: .It Ic inbinary
1192: Enable or disable the
1193: .Dv TELNET BINARY
1194: option on input.
1195: .It Ic outbinary
1196: Enable or disable the
1197: .Dv TELNET BINARY
1198: option on output.
1199: .It Ic crlf
1200: If this is
1201: .Dv TRUE ,
1202: then carriage returns will be sent as
1203: .Li <CR><LF> .
1204: If this is
1205: .Dv FALSE ,
1206: then carriage returns will be send as
1207: .Li <CR><NUL> .
1208: The initial value for this toggle is
1209: .Dv FALSE .
1210: .It Ic crmod
1211: Toggle carriage return mode.
1212: When this mode is enabled, most carriage return characters received from
1213: the remote host will be mapped into a carriage return followed by
1214: a line feed.
1215: This mode does not affect those characters typed by the user, only
1216: those received from the remote host.
1217: This mode is not very useful unless the remote host
1218: only sends carriage return, but never line feed.
1219: The initial value for this toggle is
1220: .Dv FALSE .
1221: .It Ic debug
1222: Toggles socket level debugging (useful only to the
1223: .Ic super user ) .
1224: The initial value for this toggle is
1225: .Dv FALSE .
1226: .It Ic encdebug
1227: Turns on debugging information for the encryption code.
1228: .It Ic localchars
1229: If this is
1230: .Dv TRUE ,
1231: then the
1232: .Ic flush ,
1233: .Ic interrupt ,
1234: .Ic quit ,
1235: .Ic erase ,
1236: and
1237: .Ic kill
1238: characters (see
1239: .Ic set
1240: above) are recognized locally, and transformed into (hopefully) appropriate
1241: .Tn TELNET
1242: control sequences
1243: (respectively
1244: .Ic ao ,
1245: .Ic ip ,
1246: .Ic brk ,
1247: .Ic ec ,
1248: and
1249: .Ic el ;
1250: see
1251: .Ic send
1252: above).
1253: The initial value for this toggle is
1254: .Dv TRUE
1255: in \*(Lqold line by line\*(Rq mode,
1256: and
1257: .Dv FALSE
1258: in \*(Lqcharacter at a time\*(Rq mode.
1259: When the
1260: .Dv LINEMODE
1261: option is enabled, the value of
1262: .Ic localchars
1263: is ignored, and assumed to always be
1264: .Dv TRUE .
1265: If
1266: .Dv LINEMODE
1267: has ever been enabled, then
1268: .Ic quit
1269: is sent as
1270: .Ic abort ,
1271: and
1272: .Ic eof and
1.5 ! deraadt 1273: .Ic suspend
1.1 deraadt 1274: are sent as
1275: .Ic eof and
1.5 ! deraadt 1276: .Ic susp
! 1277: (see
1.1 deraadt 1278: .Ic send
1279: above).
1280: .It Ic netdata
1281: Toggles the display of all network data (in hexadecimal format).
1282: The initial value for this toggle is
1283: .Dv FALSE .
1284: .It Ic options
1285: Toggles the display of some internal
1286: .Nm telnet
1287: protocol processing (having to do with
1288: .Tn TELNET
1289: options).
1290: The initial value for this toggle is
1291: .Dv FALSE .
1292: .It Ic prettydump
1293: When the
1294: .Ic netdata
1295: toggle is enabled, if
1296: .Ic prettydump
1297: is enabled the output from the
1298: .Ic netdata
1299: command will be formatted in a more user readable format.
1300: Spaces are put between each character in the output, and the
1301: beginning of any
1302: .Tn TELNET
1303: escape sequence is preceded by a '*' to aid in locating them.
1304: .It Ic skiprc
1305: When the skiprc toggle is
1306: .Dv TRUE ,
1307: .Tn TELNET
1308: skips the reading of the
1309: .Pa \&.telnetrc
1310: file in the users home
1311: directory when connections are opened. The initial
1312: value for this toggle is
1313: .Dv FALSE.
1314: .It Ic termdata
1315: Toggles the display of all terminal data (in hexadecimal format).
1316: The initial value for this toggle is
1317: .Dv FALSE .
1318: .It Ic verbose_encrypt
1319: When the
1320: .Ic verbose_encrypt
1321: toggle is
1322: .Dv TRUE ,
1.5 ! deraadt 1323: .Nm telnet
1.1 deraadt 1324: prints out a message each time encryption is enabled or
1325: disabled. The initial value for this toggle is
1326: .Dv FALSE.
1327: Note: Because of export controls, data encryption
1328: is not supported outside of the United States and Canada.
1329: .It Ic \&?
1330: Displays the legal
1331: .Ic toggle
1332: commands.
1333: .El
1334: .It Ic z
1335: Suspend
1336: .Nm telnet .
1337: This command only works when the user is using the
1338: .Xr csh 1 .
1339: .It Ic \&! Op Ar command
1340: Execute a single command in a subshell on the local
1341: system. If
1.5 ! deraadt 1342: .Ar command
1.1 deraadt 1343: is omitted, then an interactive
1344: subshell is invoked.
1345: .It Ic \&? Op Ar command
1346: Get help. With no arguments,
1347: .Nm telnet
1348: prints a help summary.
1349: If a command is specified,
1350: .Nm telnet
1351: will print the help information for just that command.
1352: .El
1353: .Sh ENVIRONMENT
1354: .Nm Telnet
1355: uses at least the
1356: .Ev HOME ,
1357: .Ev SHELL ,
1358: .Ev DISPLAY ,
1359: and
1360: .Ev TERM
1361: environment variables.
1362: Other environment variables may be propagated
1363: to the other side via the
1364: .Dv TELNET ENVIRON
1365: option.
1366: .Sh FILES
1367: .Bl -tag -width ~/.telnetrc -compact
1368: .It Pa ~/.telnetrc
1369: user customized telnet startup values
1370: .El
1371: .Sh HISTORY
1372: The
1373: .Nm Telnet
1374: command appeared in
1375: .Bx 4.2 .
1376: .Sh NOTES
1377: .Pp
1378: On some remote systems, echo has to be turned off manually when in
1379: \*(Lqold line by line\*(Rq mode.
1380: .Pp
1381: In \*(Lqold line by line\*(Rq mode or
1382: .Dv LINEMODE
1383: the terminal's
1384: .Ic eof
1385: character is only recognized (and sent to the remote system)
1386: when it is the first character on a line.