Annotation of src/usr.bin/telnet/telnet.1, Revision 1.3
1.3 ! niklas 1: .\" $OpenBSD: telnet.1,v 1.2 1996/03/27 19:33:08 niklas 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
552: .Oo Op Fl l
553: .Ar user
554: .Oc Ns Oo Fl
555: .Ar port Oc
556: .Xc
557: Open a connection to the named host.
558: If no port number
559: is specified,
560: .Nm telnet
561: will attempt to contact a
562: .Tn TELNET
563: server at the default port.
564: The host specification may be either a host name (see
565: .Xr hosts 5 )
566: or an Internet address specified in the \*(Lqdot notation\*(Rq (see
567: .Xr inet 3 ) .
568: The
569: .Op Fl l
570: option may be used to specify the user name
571: to be passed to the remote system via the
572: .Ev ENVIRON
573: option.
574: When connecting to a non-standard port,
575: .Nm telnet
576: omits any automatic initiation of
577: .Tn TELNET
578: options. When the port number is preceded by a minus sign,
579: the initial option negotiation is done.
580: After establishing a connection, the file
581: .Pa \&.telnetrc
582: in the
583: users home directory is opened. Lines beginning with a # are
584: comment lines. Blank lines are ignored. Lines that begin
585: without white space are the start of a machine entry. The
586: first thing on the line is the name of the machine that is
587: being connected to. The rest of the line, and successive
588: lines that begin with white space are assumed to be
589: .Nm telnet
590: commands and are processed as if they had been typed
591: in manually to the
592: .Nm telnet
593: command prompt.
594: .It Ic quit
595: Close any open
596: .Tn TELNET
597: session and exit
598: .Nm telnet .
599: An end of file (in command mode) will also close a session and exit.
600: .It Ic send Ar arguments
601: Sends one or more special character sequences to the remote host.
602: The following are the arguments which may be specified
603: (more than one argument may be specified at a time):
604: .Pp
605: .Bl -tag -width escape
606: .It Ic abort
607: Sends the
608: .Dv TELNET ABORT
609: (Abort
610: processes)
611: sequence.
612: .It Ic ao
613: Sends the
614: .Dv TELNET AO
615: (Abort Output) sequence, which should cause the remote system to flush
616: all output
617: .Em from
618: the remote system
619: .Em to
620: the user's terminal.
621: .It Ic ayt
622: Sends the
623: .Dv TELNET AYT
624: (Are You There)
625: sequence, to which the remote system may or may not choose to respond.
626: .It Ic brk
627: Sends the
628: .Dv TELNET BRK
629: (Break) sequence, which may have significance to the remote
630: system.
631: .It Ic ec
632: Sends the
633: .Dv TELNET EC
634: (Erase Character)
635: sequence, which should cause the remote system to erase the last character
636: entered.
637: .It Ic el
638: Sends the
639: .Dv TELNET EL
640: (Erase Line)
641: sequence, which should cause the remote system to erase the line currently
642: being entered.
643: .It Ic eof
644: Sends the
645: .Dv TELNET EOF
646: (End Of File)
647: sequence.
648: .It Ic eor
649: Sends the
650: .Dv TELNET EOR
651: (End of Record)
652: sequence.
653: .It Ic escape
654: Sends the current
655: .Nm telnet
656: escape character (initially \*(Lq^\*(Rq).
657: .It Ic ga
658: Sends the
659: .Dv TELNET GA
660: (Go Ahead)
661: sequence, which likely has no significance to the remote system.
662: .It Ic getstatus
663: If the remote side supports the
664: .Dv TELNET STATUS
665: command,
666: .Ic getstatus
667: will send the subnegotiation to request that the server send
668: its current option status.
669: .It Ic ip
670: Sends the
671: .Dv TELNET IP
672: (Interrupt Process) sequence, which should cause the remote
673: system to abort the currently running process.
674: .It Ic nop
675: Sends the
676: .Dv TELNET NOP
677: (No OPeration)
678: sequence.
679: .It Ic susp
680: Sends the
681: .Dv TELNET SUSP
682: (SUSPend process)
683: sequence.
684: .It Ic synch
685: Sends the
686: .Dv TELNET SYNCH
687: sequence.
688: This sequence causes the remote system to discard all previously typed
689: (but not yet read) input.
690: This sequence is sent as
691: .Tn TCP
692: urgent
693: data (and may not work if the remote system is a
694: .Bx 4.2
695: system -- if
696: it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
697: .It Ic do Ar cmd
698: .It Ic dont Ar cmd
699: .It Ic will Ar cmd
700: .It Ic wont Ar cmd
701: Sends the
702: .Dv TELNET DO
703: .Ar cmd
704: sequence.
705: .Ar Cmd
706: can be either a decimal number between 0 and 255,
707: or a symbolic name for a specific
708: .Dv TELNET
709: command.
710: .Ar Cmd
711: can also be either
712: .Ic help
713: or
714: .Ic \&?
715: to print out help information, including
716: a list of known symbolic names.
717: .It Ic \&?
718: Prints out help information for the
719: .Ic send
720: command.
721: .El
722: .It Ic set Ar argument value
723: .It Ic unset Ar argument value
724: The
725: .Ic set
726: command will set any one of a number of
727: .Nm telnet
728: variables to a specific value or to
729: .Dv TRUE .
730: The special value
731: .Ic off
732: turns off the function associated with
733: the variable, this is equivalent to using the
734: .Ic unset
735: command.
736: The
737: .Ic unset
738: command will disable or set to
739: .Dv FALSE
740: any of the specified functions.
741: The values of variables may be interrogated with the
742: .Ic display
743: command.
744: The variables which may be set or unset, but not toggled, are
745: listed here. In addition, any of the variables for the
746: .Ic toggle
747: command may be explicitly set or unset using
748: the
749: .Ic set
750: and
751: .Ic unset
752: commands.
753: .Bl -tag -width escape
754: .It Ic ayt
755: If
756: .Tn TELNET
757: is in localchars mode, or
758: .Dv LINEMODE
759: is enabled, and the status character is typed, a
760: .Dv TELNET AYT
761: sequence (see
762: .Ic send ayt
763: preceding) is sent to the
764: remote host. The initial value for the "Are You There"
765: character is the terminal's status character.
766: .It Ic echo
767: This is the value (initially \*(Lq^E\*(Rq) which, when in
768: \*(Lqline by line\*(Rq mode, toggles between doing local echoing
769: of entered characters (for normal processing), and suppressing
770: echoing of entered characters (for entering, say, a password).
771: .It Ic eof
772: If
773: .Nm telnet
774: is operating in
775: .Dv LINEMODE
776: or \*(Lqold line by line\*(Rq mode, entering this character
777: as the first character on a line will cause this character to be
778: sent to the remote system.
779: The initial value of the eof character is taken to be the terminal's
780: .Ic eof
781: character.
782: .It Ic erase
783: If
784: .Nm telnet
785: is in
786: .Ic localchars
787: mode (see
788: .Ic toggle
789: .Ic localchars
790: below),
791: .Sy and
792: if
793: .Nm telnet
794: is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
795: character is typed, a
796: .Dv TELNET EC
797: sequence (see
798: .Ic send
799: .Ic ec
800: above)
801: is sent to the remote system.
802: The initial value for the erase character is taken to be
803: the terminal's
804: .Ic erase
805: character.
806: .It Ic escape
807: This is the
808: .Nm telnet
809: escape character (initially \*(Lq^[\*(Rq) which causes entry
810: into
811: .Nm telnet
812: command mode (when connected to a remote system).
813: .It Ic flushoutput
814: If
815: .Nm telnet
816: is in
817: .Ic localchars
818: mode (see
819: .Ic toggle
820: .Ic localchars
821: below)
822: and the
823: .Ic flushoutput
824: character is typed, a
825: .Dv TELNET AO
826: sequence (see
827: .Ic send
828: .Ic ao
829: above)
830: is sent to the remote host.
831: The initial value for the flush character is taken to be
832: the terminal's
833: .Ic flush
834: character.
835: .It Ic forw1
836: .It Ic forw2
837: If
838: .Tn TELNET
839: is operating in
840: .Dv LINEMODE ,
841: these are the
842: characters that, when typed, cause partial lines to be
843: forwarded to the remote system. The initial value for
844: the forwarding characters are taken from the terminal's
845: eol and eol2 characters.
846: .It Ic interrupt
847: If
848: .Nm telnet
849: is in
850: .Ic localchars
851: mode (see
852: .Ic toggle
853: .Ic localchars
854: below)
855: and the
856: .Ic interrupt
857: character is typed, a
858: .Dv TELNET IP
859: sequence (see
860: .Ic send
861: .Ic ip
862: above)
863: is sent to the remote host.
864: The initial value for the interrupt character is taken to be
865: the terminal's
866: .Ic intr
867: character.
868: .It Ic kill
869: If
870: .Nm telnet
871: is in
872: .Ic localchars
873: mode (see
874: .Ic toggle
875: .Ic localchars
876: below),
877: .Ic and
878: if
879: .Nm telnet
880: is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
881: character is typed, a
882: .Dv TELNET EL
883: sequence (see
884: .Ic send
885: .Ic el
886: above)
887: is sent to the remote system.
888: The initial value for the kill character is taken to be
889: the terminal's
890: .Ic kill
891: character.
892: .It Ic lnext
893: If
894: .Nm telnet
895: is operating in
896: .Dv LINEMODE
897: or \*(Lqold line by line\*(Lq mode, then this character is taken to
898: be the terminal's
899: .Ic lnext
900: character.
901: The initial value for the lnext character is taken to be
902: the terminal's
903: .Ic lnext
904: character.
905: .It Ic quit
906: If
907: .Nm telnet
908: is in
909: .Ic localchars
910: mode (see
911: .Ic toggle
912: .Ic localchars
913: below)
914: and the
915: .Ic quit
916: character is typed, a
917: .Dv TELNET BRK
918: sequence (see
919: .Ic send
920: .Ic brk
921: above)
922: is sent to the remote host.
923: The initial value for the quit character is taken to be
924: the terminal's
925: .Ic quit
926: character.
927: .It Ic reprint
928: If
929: .Nm telnet
930: is operating in
931: .Dv LINEMODE
932: or \*(Lqold line by line\*(Lq mode, then this character is taken to
933: be the terminal's
934: .Ic reprint
935: character.
936: The initial value for the reprint character is taken to be
937: the terminal's
938: .Ic reprint
939: character.
940: .It Ic rlogin
941: This is the rlogin escape character.
942: If set, the normal
943: .Tn TELNET
944: escape character is ignored unless it is
945: preceded by this character at the beginning of a line.
946: This character, at the beginning of a line followed by
947: a "." closes the connection; when followed by a ^Z it
948: suspends the telnet command. The initial state is to
949: disable the rlogin escape character.
950: .It Ic start
951: If the
952: .Dv TELNET TOGGLE-FLOW-CONTROL
953: option has been enabled,
954: then this character is taken to
955: be the terminal's
956: .Ic start
957: character.
958: The initial value for the kill character is taken to be
959: the terminal's
960: .Ic start
961: character.
962: .It Ic stop
963: If the
964: .Dv TELNET TOGGLE-FLOW-CONTROL
965: option has been enabled,
966: then this character is taken to
967: be the terminal's
968: .Ic stop
969: character.
970: The initial value for the kill character is taken to be
971: the terminal's
972: .Ic stop
973: character.
974: .It Ic susp
975: If
976: .Nm telnet
977: is in
978: .Ic localchars
979: mode, or
980: .Dv LINEMODE
981: is enabled, and the
982: .Ic suspend
983: character is typed, a
984: .Dv TELNET SUSP
985: sequence (see
986: .Ic send
987: .Ic susp
988: above)
989: is sent to the remote host.
990: The initial value for the suspend character is taken to be
991: the terminal's
992: .Ic suspend
993: character.
994: .It Ic tracefile
995: This is the file to which the output, caused by
996: .Ic netdata
997: or
998: .Ic option
999: tracing being
1000: .Dv TRUE ,
1001: will be written. If it is set to
1002: .Dq Fl ,
1003: then tracing information will be written to standard output (the default).
1004: .It Ic worderase
1005: If
1006: .Nm telnet
1007: is operating in
1008: .Dv LINEMODE
1009: or \*(Lqold line by line\*(Lq mode, then this character is taken to
1010: be the terminal's
1011: .Ic worderase
1012: character.
1013: The initial value for the worderase character is taken to be
1014: the terminal's
1015: .Ic worderase
1016: character.
1017: .It Ic \&?
1018: Displays the legal
1019: .Ic set
1020: .Pq Ic unset
1021: commands.
1022: .El
1023: .It Ic slc Ar state
1024: The
1025: .Ic slc
1026: command (Set Local Characters) is used to set
1027: or change the state of the the special
1028: characters when the
1029: .Dv TELNET LINEMODE
1030: option has
1031: been enabled. Special characters are characters that get
1032: mapped to
1033: .Tn TELNET
1034: commands sequences (like
1035: .Ic ip
1036: or
1037: .Ic quit )
1038: or line editing characters (like
1039: .Ic erase
1040: and
1041: .Ic kill ) .
1042: By default, the local special characters are exported.
1043: .Bl -tag -width Fl
1044: .It Ic check
1045: Verify the current settings for the current special characters.
1046: The remote side is requested to send all the current special
1047: character settings, and if there are any discrepancies with
1048: the local side, the local side will switch to the remote value.
1049: .It Ic export
1050: Switch to the local defaults for the special characters. The
1051: local default characters are those of the local terminal at
1052: the time when
1053: .Nm telnet
1054: was started.
1055: .It Ic import
1056: Switch to the remote defaults for the special characters.
1057: The remote default characters are those of the remote system
1058: at the time when the
1059: .Tn TELNET
1060: connection was established.
1061: .It Ic \&?
1062: Prints out help information for the
1063: .Ic slc
1064: command.
1065: .El
1066: .It Ic status
1067: Show the current status of
1068: .Nm telnet .
1069: This includes the peer one is connected to, as well
1070: as the current mode.
1071: .It Ic toggle Ar arguments ...
1072: Toggle (between
1073: .Dv TRUE
1074: and
1075: .Dv FALSE )
1076: various flags that control how
1077: .Nm telnet
1078: responds to events.
1079: These flags may be set explicitly to
1080: .Dv TRUE
1081: or
1082: .Dv FALSE
1083: using the
1084: .Ic set
1085: and
1086: .Ic unset
1087: commands listed above.
1088: More than one argument may be specified.
1089: The state of these flags may be interrogated with the
1090: .Ic display
1091: command.
1092: Valid arguments are:
1093: .Bl -tag -width Ar
1094: .It Ic authdebug
1095: Turns on debugging information for the authentication code.
1096: .It Ic autoflush
1097: If
1098: .Ic autoflush
1099: and
1100: .Ic localchars
1101: are both
1102: .Dv TRUE ,
1103: then when the
1104: .Ic ao ,
1105: or
1106: .Ic quit
1107: characters are recognized (and transformed into
1108: .Tn TELNET
1109: sequences; see
1110: .Ic set
1111: above for details),
1112: .Nm telnet
1113: refuses to display any data on the user's terminal
1114: until the remote system acknowledges (via a
1115: .Dv TELNET TIMING MARK
1116: option)
1117: that it has processed those
1118: .Tn TELNET
1119: sequences.
1120: The initial value for this toggle is
1121: .Dv TRUE
1122: if the terminal user had not
1123: done an "stty noflsh", otherwise
1124: .Dv FALSE
1125: (see
1126: .Xr stty 1 ) .
1127: .It Ic autodecrypt
1128: When the
1129: .Dv TELNET ENCRYPT
1130: option is negotiated, by
1131: default the actual encryption (decryption) of the data
1132: stream does not start automatically. The autoencrypt
1133: (autodecrypt) command states that encryption of the
1134: output (input) stream should be enabled as soon as
1135: possible.
1136: .Pp
1137: Note: Because of export controls, the
1138: .Dv TELNET ENCRYPT
1139: option is not supported outside the United States and Canada.
1140: .It Ic autologin
1141: If the remote side supports the
1142: .Dv TELNET AUTHENTICATION
1143: option
1144: .Tn TELNET
1145: attempts to use it to perform automatic authentication. If the
1146: .Dv AUTHENTICATION
1147: option is not supported, the user's login
1148: name are propagated through the
1149: .Dv TELNET ENVIRON
1150: option.
1151: This command is the same as specifying
1152: .Ar a
1153: option on the
1154: .Ic open
1155: command.
1156: .It Ic autosynch
1157: If
1158: .Ic autosynch
1159: and
1160: .Ic localchars
1161: are both
1162: .Dv TRUE ,
1163: then when either the
1164: .Ic intr
1165: or
1166: .Ic quit
1167: characters is typed (see
1168: .Ic set
1169: above for descriptions of the
1170: .Ic intr
1171: and
1172: .Ic quit
1173: characters), the resulting
1174: .Tn TELNET
1175: sequence sent is followed by the
1176: .Dv TELNET SYNCH
1177: sequence.
1178: This procedure
1179: .Ic should
1180: cause the remote system to begin throwing away all previously
1181: typed input until both of the
1182: .Tn TELNET
1183: sequences have been read and acted upon.
1184: The initial value of this toggle is
1185: .Dv FALSE .
1186: .It Ic binary
1187: Enable or disable the
1188: .Dv TELNET BINARY
1189: option on both input and output.
1190: .It Ic inbinary
1191: Enable or disable the
1192: .Dv TELNET BINARY
1193: option on input.
1194: .It Ic outbinary
1195: Enable or disable the
1196: .Dv TELNET BINARY
1197: option on output.
1198: .It Ic crlf
1199: If this is
1200: .Dv TRUE ,
1201: then carriage returns will be sent as
1202: .Li <CR><LF> .
1203: If this is
1204: .Dv FALSE ,
1205: then carriage returns will be send as
1206: .Li <CR><NUL> .
1207: The initial value for this toggle is
1208: .Dv FALSE .
1209: .It Ic crmod
1210: Toggle carriage return mode.
1211: When this mode is enabled, most carriage return characters received from
1212: the remote host will be mapped into a carriage return followed by
1213: a line feed.
1214: This mode does not affect those characters typed by the user, only
1215: those received from the remote host.
1216: This mode is not very useful unless the remote host
1217: only sends carriage return, but never line feed.
1218: The initial value for this toggle is
1219: .Dv FALSE .
1220: .It Ic debug
1221: Toggles socket level debugging (useful only to the
1222: .Ic super user ) .
1223: The initial value for this toggle is
1224: .Dv FALSE .
1225: .It Ic encdebug
1226: Turns on debugging information for the encryption code.
1227: .It Ic localchars
1228: If this is
1229: .Dv TRUE ,
1230: then the
1231: .Ic flush ,
1232: .Ic interrupt ,
1233: .Ic quit ,
1234: .Ic erase ,
1235: and
1236: .Ic kill
1237: characters (see
1238: .Ic set
1239: above) are recognized locally, and transformed into (hopefully) appropriate
1240: .Tn TELNET
1241: control sequences
1242: (respectively
1243: .Ic ao ,
1244: .Ic ip ,
1245: .Ic brk ,
1246: .Ic ec ,
1247: and
1248: .Ic el ;
1249: see
1250: .Ic send
1251: above).
1252: The initial value for this toggle is
1253: .Dv TRUE
1254: in \*(Lqold line by line\*(Rq mode,
1255: and
1256: .Dv FALSE
1257: in \*(Lqcharacter at a time\*(Rq mode.
1258: When the
1259: .Dv LINEMODE
1260: option is enabled, the value of
1261: .Ic localchars
1262: is ignored, and assumed to always be
1263: .Dv TRUE .
1264: If
1265: .Dv LINEMODE
1266: has ever been enabled, then
1267: .Ic quit
1268: is sent as
1269: .Ic abort ,
1270: and
1271: .Ic eof and
1272: .B suspend
1273: are sent as
1274: .Ic eof and
1275: .Ic susp ,
1276: see
1277: .Ic send
1278: above).
1279: .It Ic netdata
1280: Toggles the display of all network data (in hexadecimal format).
1281: The initial value for this toggle is
1282: .Dv FALSE .
1283: .It Ic options
1284: Toggles the display of some internal
1285: .Nm telnet
1286: protocol processing (having to do with
1287: .Tn TELNET
1288: options).
1289: The initial value for this toggle is
1290: .Dv FALSE .
1291: .It Ic prettydump
1292: When the
1293: .Ic netdata
1294: toggle is enabled, if
1295: .Ic prettydump
1296: is enabled the output from the
1297: .Ic netdata
1298: command will be formatted in a more user readable format.
1299: Spaces are put between each character in the output, and the
1300: beginning of any
1301: .Tn TELNET
1302: escape sequence is preceded by a '*' to aid in locating them.
1303: .It Ic skiprc
1304: When the skiprc toggle is
1305: .Dv TRUE ,
1306: .Tn TELNET
1307: skips the reading of the
1308: .Pa \&.telnetrc
1309: file in the users home
1310: directory when connections are opened. The initial
1311: value for this toggle is
1312: .Dv FALSE.
1313: .It Ic termdata
1314: Toggles the display of all terminal data (in hexadecimal format).
1315: The initial value for this toggle is
1316: .Dv FALSE .
1317: .It Ic verbose_encrypt
1318: When the
1319: .Ic verbose_encrypt
1320: toggle is
1321: .Dv TRUE ,
1322: .Tn TELNET
1323: prints out a message each time encryption is enabled or
1324: disabled. The initial value for this toggle is
1325: .Dv FALSE.
1326: Note: Because of export controls, data encryption
1327: is not supported outside of the United States and Canada.
1328: .It Ic \&?
1329: Displays the legal
1330: .Ic toggle
1331: commands.
1332: .El
1333: .It Ic z
1334: Suspend
1335: .Nm telnet .
1336: This command only works when the user is using the
1337: .Xr csh 1 .
1338: .It Ic \&! Op Ar command
1339: Execute a single command in a subshell on the local
1340: system. If
1341: .Ic command
1342: is omitted, then an interactive
1343: subshell is invoked.
1344: .It Ic \&? Op Ar command
1345: Get help. With no arguments,
1346: .Nm telnet
1347: prints a help summary.
1348: If a command is specified,
1349: .Nm telnet
1350: will print the help information for just that command.
1351: .El
1352: .Sh ENVIRONMENT
1353: .Nm Telnet
1354: uses at least the
1355: .Ev HOME ,
1356: .Ev SHELL ,
1357: .Ev DISPLAY ,
1358: and
1359: .Ev TERM
1360: environment variables.
1361: Other environment variables may be propagated
1362: to the other side via the
1363: .Dv TELNET ENVIRON
1364: option.
1365: .Sh FILES
1366: .Bl -tag -width ~/.telnetrc -compact
1367: .It Pa ~/.telnetrc
1368: user customized telnet startup values
1369: .El
1370: .Sh HISTORY
1371: The
1372: .Nm Telnet
1373: command appeared in
1374: .Bx 4.2 .
1375: .Sh NOTES
1376: .Pp
1377: On some remote systems, echo has to be turned off manually when in
1378: \*(Lqold line by line\*(Rq mode.
1379: .Pp
1380: In \*(Lqold line by line\*(Rq mode or
1381: .Dv LINEMODE
1382: the terminal's
1383: .Ic eof
1384: character is only recognized (and sent to the remote system)
1385: when it is the first character on a line.