Commit | Line | Data |
---|---|---|
b5dc1377 | 1 | .\" Copyright (c) 1983, 1990 The Regents of the University of California. |
59ccfe44 | 2 | .\" All rights reserved. |
24854a1c | 3 | .\" |
263cc8fc | 4 | .\" %sccs.include.redist.roff% |
24854a1c | 5 | .\" |
263cc8fc | 6 | .\" @(#)telnet.1 6.16 (Berkeley) %G% |
59ccfe44 | 7 | .\" |
b5dc1377 CL |
8 | .Dd |
9 | .Dt TELNET 1 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm telnet | |
13 | .Nd user interface to the | |
263cc8fc | 14 | .Tn TELNET |
b5dc1377 CL |
15 | protocol |
16 | .Sh SYNOPSIS | |
17 | .Nm telnet | |
18 | .Op Fl d | |
d2063892 | 19 | .Op Fl a |
b5dc1377 | 20 | .Op Fl n Ar tracefile |
2dfee3aa CL |
21 | .Ar host |
22 | .Op port | |
263cc8fc | 23 | .Oc |
b5dc1377 | 24 | .Sh DESCRIPTION |
b750597e | 25 | The |
b5dc1377 | 26 | .Nm telnet |
b750597e | 27 | command |
b5dc1377 | 28 | is used to communicate with another host using the |
263cc8fc | 29 | .Tn TELNET |
b5dc1377 CL |
30 | protocol. |
31 | If | |
32 | .Nm telnet | |
b750597e | 33 | is invoked without the |
b5dc1377 | 34 | .Ar host |
b750597e | 35 | argument, it enters command mode, |
b5dc1377 CL |
36 | indicated by its prompt |
37 | .Pq Nm telnet\&> . | |
24854a1c KM |
38 | In this mode, it accepts and executes the commands listed below. |
39 | If it is invoked with arguments, it performs an | |
b5dc1377 CL |
40 | .Ic open |
41 | command with those arguments. | |
42 | .Pp | |
43 | Options: | |
263cc8fc CL |
44 | .Bl -tag -width indent |
45 | .It Fl d | |
b5dc1377 CL |
46 | Sets the initial value of the |
47 | .Ic debug | |
48 | toggle to | |
263cc8fc CL |
49 | .Dv TRUE |
50 | .It Fl a | |
d2063892 | 51 | Attempt automatic login. |
263cc8fc CL |
52 | Currently, this sends the user name via the |
53 | .Ev USER | |
54 | variable | |
55 | of the | |
56 | .Ev ENVIRON | |
57 | option if supported by the remote system. | |
d2063892 MK |
58 | The name used is that of the current user as returned by |
59 | .Xr getlogin 2 | |
60 | if it agrees with the current user ID, | |
61 | otherwise it is the name associated with the user ID. | |
263cc8fc | 62 | .It Fl n Ar tracefile |
b5dc1377 CL |
63 | Opens |
64 | .Ar tracefile | |
65 | for recording trace information. | |
66 | See the | |
67 | .Ic set tracefile | |
68 | command below. | |
263cc8fc | 69 | .It Ar host |
b5dc1377 CL |
70 | Indicates the official name, an alias, or the Internet address |
71 | of a remote host. | |
263cc8fc | 72 | .It Ar port |
b5dc1377 CL |
73 | Indicates a port number (address of an application). If a number is |
74 | not specified, the default | |
75 | .Nm telnet | |
76 | port is used. | |
263cc8fc | 77 | .El |
b5dc1377 | 78 | .Pp |
24854a1c | 79 | Once a connection has been opened, |
b5dc1377 | 80 | .Nm telnet |
b750597e | 81 | will attempt to enable the |
263cc8fc | 82 | .Dv TELNET LINEMODE |
b750597e PB |
83 | option. |
84 | If this fails, then | |
b5dc1377 | 85 | .Nm telnet |
b750597e | 86 | will revert to one of two input modes: |
b5dc1377 CL |
87 | either \*(Lqcharacter at a time\*(Rq |
88 | or \*(Lqold line by line\*(Rq | |
5c2bded5 | 89 | depending on what the remote system supports. |
b5dc1377 CL |
90 | .Pp |
91 | When | |
263cc8fc | 92 | .Dv LINEMODE |
b5dc1377 | 93 | is enabled, character processing is done on the |
b750597e PB |
94 | local system, under the control of the remote system. When input |
95 | editing or character echoing is to be disabled, the remote system | |
96 | will relay that information. The remote system will also relay | |
97 | changes to any special characters that happen on the remote | |
98 | system, so that they can take effect on the local system. | |
b5dc1377 CL |
99 | .Pp |
100 | In \*(Lqcharacter at a time\*(Rq mode, most | |
5c2bded5 | 101 | text typed is immediately sent to the remote host for processing. |
b5dc1377 CL |
102 | .Pp |
103 | In \*(Lqold line by line\*(Rq mode, all text is echoed locally, | |
5c2bded5 | 104 | and (normally) only completed lines are sent to the remote host. |
b5dc1377 | 105 | The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used |
5c2bded5 GM |
106 | to turn off and on the local echo |
107 | (this would mostly be used to enter passwords | |
108 | without the password being echoed). | |
b5dc1377 CL |
109 | .Pp |
110 | If the | |
263cc8fc | 111 | .Dv LINEMODE |
b5dc1377 CL |
112 | option is enabled, or if the |
113 | .Ic localchars | |
263cc8fc CL |
114 | toggle is |
115 | .Dv TRUE | |
116 | (the default for \*(Lqold line by line\*(Lq; see below), | |
5c2bded5 | 117 | the user's |
b5dc1377 CL |
118 | .Ic quit , |
119 | .Ic intr , | |
5c2bded5 | 120 | and |
b5dc1377 | 121 | .Ic flush |
5c2bded5 | 122 | characters are trapped locally, and sent as |
263cc8fc | 123 | .Tn TELNET |
5c2bded5 | 124 | protocol sequences to the remote side. |
b5dc1377 | 125 | If |
263cc8fc | 126 | .Dv LINEMODE |
b5dc1377 CL |
127 | has ever been enabled, then the user's |
128 | .Ic susp | |
b750597e | 129 | and |
b5dc1377 | 130 | .Ic eof |
b750597e | 131 | are also sent as |
263cc8fc | 132 | .Tn TELNET |
b750597e PB |
133 | protocol sequences, |
134 | and | |
b5dc1377 CL |
135 | .Ic quit |
136 | is sent as a | |
263cc8fc | 137 | .Dv TELNET ABORT |
b5dc1377 | 138 | instead of |
263cc8fc | 139 | .Dv BREAK |
5c2bded5 | 140 | There are options (see |
b5dc1377 CL |
141 | .Ic toggle |
142 | .Ic autoflush | |
5c2bded5 | 143 | and |
b5dc1377 CL |
144 | .Ic toggle |
145 | .Ic autosynch | |
5c2bded5 GM |
146 | below) |
147 | which cause this action to flush subsequent output to the terminal | |
148 | (until the remote host acknowledges the | |
263cc8fc | 149 | .Tn TELNET |
5c2bded5 GM |
150 | sequence) and flush previous terminal input |
151 | (in the case of | |
b5dc1377 | 152 | .Ic quit |
5c2bded5 | 153 | and |
b5dc1377 CL |
154 | .Ic intr ) . |
155 | .Pp | |
5c2bded5 | 156 | While connected to a remote host, |
b5dc1377 | 157 | .Nm telnet |
5c2bded5 | 158 | command mode may be entered by typing the |
b5dc1377 | 159 | .Nm telnet |
f9ae868f | 160 | \*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq). |
24854a1c | 161 | When in command mode, the normal terminal editing conventions are available. |
b5dc1377 | 162 | .Pp |
f9ae868f SS |
163 | The following |
164 | .Nm telnet | |
b5dc1377 | 165 | commands are available. |
5c2bded5 GM |
166 | Only enough of each command to uniquely identify it need be typed |
167 | (this is also true for arguments to the | |
b5dc1377 CL |
168 | .Ic mode , |
169 | .Ic set , | |
170 | .Ic toggle , | |
171 | .Ic unset , | |
172 | .Ic slc , | |
5c2bded5 | 173 | and |
b5dc1377 | 174 | .Ic display |
5c2bded5 | 175 | commands). |
b5dc1377 | 176 | .Pp |
263cc8fc CL |
177 | .Bl -tag -width "mode type" |
178 | .It Ic close | |
5c2bded5 | 179 | Close a |
263cc8fc | 180 | .Tn TELNET |
5c2bded5 | 181 | session and return to command mode. |
263cc8fc | 182 | .It Ic display Ar argument ... |
b750597e | 183 | Displays all, or some, of the |
b5dc1377 | 184 | .Ic set |
b750597e | 185 | and |
b5dc1377 | 186 | .Ic toggle |
b750597e | 187 | values (see below). |
263cc8fc | 188 | .It Ic mode Ar type |
b5dc1377 | 189 | .Ar Type |
b750597e | 190 | is one of several options, depending on the state of the |
263cc8fc | 191 | .Tn TELNET |
b750597e | 192 | session. |
5c2bded5 GM |
193 | The remote host is asked for permission to go into the requested mode. |
194 | If the remote host is capable of entering that mode, the requested | |
195 | mode will be entered. | |
263cc8fc CL |
196 | .Bl -tag -width Ar |
197 | .It Ic character | |
b750597e | 198 | Disable the |
263cc8fc | 199 | .Dv TELNET LINEMODE |
b750597e | 200 | option, or, if the remote side does not understand the |
263cc8fc | 201 | .Dv LINEMODE |
b5dc1377 | 202 | option, then enter \*(Lqcharacter at a time\*(Lq mode. |
263cc8fc | 203 | .It Ic line |
b750597e | 204 | Enable the |
263cc8fc | 205 | .Dv TELNET LINEMODE |
b750597e | 206 | option, or, if the remote side does not understand the |
263cc8fc | 207 | .Dv LINEMODE |
b5dc1377 | 208 | option, then attempt to enter \*(Lqold-line-by-line\*(Lq mode. |
263cc8fc | 209 | .It Ic isig Pq Ic \-isig |
b5dc1377 | 210 | Attempt to enable (disable) the |
263cc8fc | 211 | .Dv TRAPSIG |
b5dc1377 | 212 | mode of the |
263cc8fc | 213 | .Dv LINEMODE |
b5dc1377 CL |
214 | option. |
215 | This requires that the | |
263cc8fc | 216 | .Dv LINEMODE |
b5dc1377 | 217 | option be enabled. |
263cc8fc | 218 | .It Ic edit Pq Ic \-edit |
b5dc1377 | 219 | Attempt to enable (disable) the |
263cc8fc | 220 | .Dv EDIT |
b5dc1377 | 221 | mode of the |
263cc8fc | 222 | .Dv LINEMODE |
b5dc1377 CL |
223 | option. |
224 | This requires that the | |
263cc8fc | 225 | .Dv LINEMODE |
b5dc1377 | 226 | option be enabled. |
263cc8fc | 227 | .It Ic \&? |
b750597e | 228 | Prints out help information for the |
b5dc1377 | 229 | .Ic mode |
b750597e | 230 | command. |
263cc8fc CL |
231 | .Oc Ns Oo Fl |
232 | .Ar port Oc | |
233 | .Xc | |
b750597e PB |
234 | Open a connection to the named host. |
235 | If no port number | |
b5dc1377 CL |
236 | is specified, |
237 | .Nm telnet | |
b750597e | 238 | will attempt to contact a |
263cc8fc | 239 | .Tn TELNET |
b750597e | 240 | server at the default port. |
b5dc1377 CL |
241 | The host specification may be either a host name (see |
242 | .Xr hosts 5 ) | |
243 | or an Internet address specified in the \*(Lqdot notation\*(Rq (see | |
244 | .Xr inet 3 ) . | |
b750597e | 245 | When connecting to a non-standard port, |
b5dc1377 | 246 | .Nm telnet |
b750597e | 247 | omits any automatic initiation of |
263cc8fc | 248 | .Tn TELNET |
b750597e PB |
249 | options. When the port number is preceeded by a minus sign, |
250 | the inital option negotiation is done. | |
b5dc1377 CL |
251 | After establishing a connection, the file |
252 | .Pa \&.telnetrc | |
253 | in the | |
b750597e PB |
254 | users home directory is opened. Lines begining with a # are |
255 | comment lines. Blank lines are ignored. Lines that begin | |
256 | without whitespace are the start of a machine entry. The | |
257 | first thing on the line is the name of the machine that is | |
258 | being connected to. The rest of the line, and successive | |
259 | lines that begin with whitespace are assumed to be | |
b5dc1377 | 260 | .Nm telnet |
b750597e PB |
261 | commands and are processed as if they had been typed |
262 | in manually to the | |
b5dc1377 | 263 | .Nm telnet |
b750597e | 264 | command prompt. |
263cc8fc | 265 | .It Ic quit |
b750597e | 266 | Close any open |
263cc8fc | 267 | .Tn TELNET |
b5dc1377 CL |
268 | session and exit |
269 | .Nm telnet . | |
b750597e | 270 | An end of file (in command mode) will also close a session and exit. |
263cc8fc | 271 | .It Ic send Ar arguments |
b750597e PB |
272 | Sends one or more special character sequences to the remote host. |
273 | The following are the arguments which may be specified | |
274 | (more than one argument may be specified at a time): | |
b5dc1377 | 275 | .Pp |
263cc8fc CL |
276 | .Bl -tag -width escape |
277 | .It Ic abort | |
5c2bded5 | 278 | Sends the |
263cc8fc CL |
279 | .Dv TELNET ABORT |
280 | (Abort | |
281 | processes) | |
b750597e | 282 | sequence. |
263cc8fc | 283 | .It Ic ao |
5c2bded5 | 284 | Sends the |
263cc8fc | 285 | .Dv TELNET AO |
5c2bded5 GM |
286 | (Abort Output) sequence, which should cause the remote system to flush |
287 | all output | |
b5dc1377 | 288 | .Em from |
5c2bded5 | 289 | the remote system |
b5dc1377 | 290 | .Em to |
5c2bded5 | 291 | the user's terminal. |
263cc8fc | 292 | .It Ic ayt |
5c2bded5 | 293 | Sends the |
263cc8fc | 294 | .Dv TELNET AYT |
5c2bded5 | 295 | (Are You There) |
349a83e1 | 296 | sequence, to which the remote system may or may not choose to respond. |
263cc8fc | 297 | .It Ic brk |
5c2bded5 | 298 | Sends the |
263cc8fc | 299 | .Dv TELNET BRK |
b750597e PB |
300 | (Break) sequence, which may have significance to the remote |
301 | system. | |
263cc8fc | 302 | .It Ic ec |
b750597e | 303 | Sends the |
263cc8fc | 304 | .Dv TELNET EC |
5c2bded5 GM |
305 | (Erase Character) |
306 | sequence, which should cause the remote system to erase the last character | |
307 | entered. | |
263cc8fc | 308 | .It Ic el |
5c2bded5 | 309 | Sends the |
263cc8fc | 310 | .Dv TELNET EL |
5c2bded5 GM |
311 | (Erase Line) |
312 | sequence, which should cause the remote system to erase the line currently | |
313 | being entered. | |
263cc8fc | 314 | .It Ic eof |
b750597e | 315 | Sends the |
263cc8fc | 316 | .Dv TELNET EOF |
b750597e PB |
317 | (End Of File) |
318 | sequence. | |
263cc8fc | 319 | .It Ic eor |
b750597e | 320 | Sends the |
263cc8fc | 321 | .Dv TELNET EOR |
b750597e PB |
322 | (End of Record) |
323 | sequence. | |
263cc8fc | 324 | .It Ic escape |
b750597e | 325 | Sends the current |
b5dc1377 CL |
326 | .Nm telnet |
327 | escape character (initially \*(Lq^\*(Rq). | |
263cc8fc | 328 | .It Ic ga |
5c2bded5 | 329 | Sends the |
263cc8fc | 330 | .Dv TELNET GA |
5c2bded5 GM |
331 | (Go Ahead) |
332 | sequence, which likely has no significance to the remote system. | |
263cc8fc | 333 | .It Ic getstatus |
6570c863 | 334 | If the remote side supports the |
263cc8fc | 335 | .Dv TELNET STATUS |
6570c863 | 336 | command, |
b5dc1377 | 337 | .Ic getstatus |
6570c863 PB |
338 | will send the subnegotiation to request that the server send |
339 | its current option status. | |
263cc8fc | 340 | .It Ic ip |
5c2bded5 | 341 | Sends the |
263cc8fc | 342 | .Dv TELNET IP |
b750597e PB |
343 | (Interrupt Process) sequence, which should cause the remote |
344 | system to abort the currently running process. | |
263cc8fc | 345 | .It Ic nop |
b750597e | 346 | Sends the |
263cc8fc | 347 | .Dv TELNET NOP |
5c2bded5 GM |
348 | (No OPeration) |
349 | sequence. | |
263cc8fc | 350 | .It Ic susp |
b750597e | 351 | Sends the |
263cc8fc | 352 | .Dv TELNET SUSP |
b750597e PB |
353 | (SUSPend process) |
354 | sequence. | |
263cc8fc | 355 | .It Ic synch |
b750597e | 356 | Sends the |
263cc8fc | 357 | .Dv TELNET SYNCH |
b750597e PB |
358 | sequence. |
359 | This sequence causes the remote system to discard all previously typed | |
360 | (but not yet read) input. | |
263cc8fc CL |
361 | This sequence is sent as |
362 | .Tn TCP | |
363 | urgent | |
364 | data (and may not work if the remote system is a | |
365 | .Bx 4.2 | |
366 | system -- if | |
b5dc1377 | 367 | it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal). |
263cc8fc | 368 | .It Ic \&? |
5c2bded5 | 369 | Prints out help information for the |
b5dc1377 | 370 | .Ic send |
5c2bded5 | 371 | command. |
263cc8fc CL |
372 | .El |
373 | .It Ic set Ar argument value | |
374 | .It Ic unset Ar argument value | |
b750597e | 375 | The |
b5dc1377 | 376 | .Ic set |
b750597e | 377 | command will set any one of a number of |
b5dc1377 | 378 | .Nm telnet |
263cc8fc CL |
379 | variables to a specific value or to |
380 | .Dv TRUE . | |
b5dc1377 CL |
381 | The special value |
382 | .Ic off | |
383 | turns off the function associated with | |
b750597e | 384 | the variable, this is equivalent to using the |
b5dc1377 | 385 | .Ic unset |
b750597e PB |
386 | command. |
387 | The | |
b5dc1377 | 388 | .Ic unset |
263cc8fc CL |
389 | command will disable or set to |
390 | .Dv FALSE | |
391 | any of the specified functions. | |
349a83e1 | 392 | The values of variables may be interrogated with the |
b5dc1377 | 393 | .Ic display |
349a83e1 | 394 | command. |
b750597e PB |
395 | The variables which may be set or unset, but not toggled, are |
396 | listed here. In addition, any of the variables for the | |
b5dc1377 CL |
397 | .Ic toggle |
398 | command may be explicitly set or unset using | |
399 | the | |
400 | .Ic set | |
401 | and | |
402 | .Ic unset | |
403 | commands. | |
263cc8fc CL |
404 | .Bl -tag -width escape |
405 | .It Ic echo | |
b5dc1377 CL |
406 | This is the value (initially \*(Lq^E\*(Rq) which, when in |
407 | \*(Lqline by line\*(Rq mode, toggles between doing local echoing | |
5c2bded5 GM |
408 | of entered characters (for normal processing), and suppressing |
409 | echoing of entered characters (for entering, say, a password). | |
263cc8fc | 410 | .It Ic eof |
b750597e | 411 | If |
b5dc1377 | 412 | .Nm telnet |
b750597e | 413 | is operating in |
263cc8fc | 414 | .Dv LINEMODE |
b5dc1377 | 415 | or \*(Lqold line by line\*(Rq mode, entering this character |
b750597e PB |
416 | as the first character on a line will cause this character to be |
417 | sent to the remote system. | |
418 | The initial value of the eof character is taken to be the terminal's | |
b5dc1377 | 419 | .Ic eof |
b750597e | 420 | character. |
263cc8fc | 421 | .It Ic erase |
5c2bded5 | 422 | If |
b5dc1377 | 423 | .Nm telnet |
5c2bded5 | 424 | is in |
b5dc1377 | 425 | .Ic localchars |
5c2bded5 | 426 | mode (see |
b5dc1377 CL |
427 | .Ic toggle |
428 | .Ic localchars | |
b750597e | 429 | below), |
b5dc1377 | 430 | .Sy and |
b750597e | 431 | if |
b5dc1377 CL |
432 | .Nm telnet |
433 | is operating in \*(Lqcharacter at a time\*(Rq mode, then when this | |
5c2bded5 | 434 | character is typed, a |
263cc8fc | 435 | .Dv TELNET EC |
5c2bded5 | 436 | sequence (see |
b5dc1377 CL |
437 | .Ic send |
438 | .Ic ec | |
5c2bded5 | 439 | above) |
b750597e PB |
440 | is sent to the remote system. |
441 | The initial value for the erase character is taken to be | |
5c2bded5 | 442 | the terminal's |
b5dc1377 | 443 | .Ic erase |
5c2bded5 | 444 | character. |
263cc8fc | 445 | .It Ic escape |
b750597e | 446 | This is the |
b5dc1377 CL |
447 | .Nm telnet |
448 | escape character (initially \*(Lq^[\*(Rq) which causes entry | |
b750597e | 449 | into |
b5dc1377 | 450 | .Nm telnet |
b750597e | 451 | command mode (when connected to a remote system). |
263cc8fc | 452 | .It Ic flushoutput |
5c2bded5 | 453 | If |
b5dc1377 | 454 | .Nm telnet |
5c2bded5 | 455 | is in |
b5dc1377 | 456 | .Ic localchars |
5c2bded5 | 457 | mode (see |
b5dc1377 CL |
458 | .Ic toggle |
459 | .Ic localchars | |
5c2bded5 GM |
460 | below) |
461 | and the | |
b5dc1377 | 462 | .Ic flushoutput |
5c2bded5 | 463 | character is typed, a |
263cc8fc | 464 | .Dv TELNET AO |
5c2bded5 | 465 | sequence (see |
b5dc1377 CL |
466 | .Ic send |
467 | .Ic ao | |
5c2bded5 GM |
468 | above) |
469 | is sent to the remote host. | |
b750597e | 470 | The initial value for the flush character is taken to be |
5c2bded5 | 471 | the terminal's |
b5dc1377 | 472 | .Ic flush |
5c2bded5 | 473 | character. |
263cc8fc | 474 | .It Ic interrupt |
5c2bded5 | 475 | If |
b5dc1377 | 476 | .Nm telnet |
5c2bded5 | 477 | is in |
b5dc1377 | 478 | .Ic localchars |
5c2bded5 | 479 | mode (see |
b5dc1377 CL |
480 | .Ic toggle |
481 | .Ic localchars | |
5c2bded5 GM |
482 | below) |
483 | and the | |
b5dc1377 | 484 | .Ic interrupt |
5c2bded5 | 485 | character is typed, a |
263cc8fc | 486 | .Dv TELNET IP |
5c2bded5 | 487 | sequence (see |
b5dc1377 CL |
488 | .Ic send |
489 | .Ic ip | |
5c2bded5 GM |
490 | above) |
491 | is sent to the remote host. | |
b750597e | 492 | The initial value for the interrupt character is taken to be |
5c2bded5 | 493 | the terminal's |
b5dc1377 | 494 | .Ic intr |
5c2bded5 | 495 | character. |
263cc8fc | 496 | .It Ic kill |
5c2bded5 | 497 | If |
b5dc1377 | 498 | .Nm telnet |
5c2bded5 | 499 | is in |
b5dc1377 | 500 | .Ic localchars |
5c2bded5 | 501 | mode (see |
b5dc1377 CL |
502 | .Ic toggle |
503 | .Ic localchars | |
5c2bded5 | 504 | below), |
b5dc1377 | 505 | .Ic and |
5c2bded5 | 506 | if |
b5dc1377 CL |
507 | .Nm telnet |
508 | is operating in \*(Lqcharacter at a time\*(Rq mode, then when this | |
5c2bded5 | 509 | character is typed, a |
263cc8fc | 510 | .Dv TELNET EL |
5c2bded5 | 511 | sequence (see |
b5dc1377 CL |
512 | .Ic send |
513 | .Ic el | |
5c2bded5 GM |
514 | above) |
515 | is sent to the remote system. | |
b750597e | 516 | The initial value for the kill character is taken to be |
5c2bded5 | 517 | the terminal's |
b5dc1377 | 518 | .Ic kill |
b750597e | 519 | character. |
263cc8fc | 520 | .It Ic lnext |
b750597e | 521 | If |
b5dc1377 | 522 | .Nm telnet |
b750597e | 523 | is operating in |
263cc8fc | 524 | .Dv LINEMODE |
b5dc1377 | 525 | or \*(Lqold line by line\*(Lq mode, then this character is taken to |
b750597e | 526 | be the terminal's |
b5dc1377 | 527 | .Ic lnext |
b750597e PB |
528 | character. |
529 | The initial value for the lnext character is taken to be | |
530 | the terminal's | |
b5dc1377 | 531 | .Ic lnext |
5c2bded5 | 532 | character. |
263cc8fc | 533 | .It Ic quit |
5c2bded5 | 534 | If |
b5dc1377 | 535 | .Nm telnet |
5c2bded5 | 536 | is in |
b5dc1377 | 537 | .Ic localchars |
5c2bded5 | 538 | mode (see |
b5dc1377 CL |
539 | .Ic toggle |
540 | .Ic localchars | |
b750597e PB |
541 | below) |
542 | and the | |
b5dc1377 | 543 | .Ic quit |
5c2bded5 | 544 | character is typed, a |
263cc8fc | 545 | .Dv TELNET BRK |
5c2bded5 | 546 | sequence (see |
b5dc1377 CL |
547 | .Ic send |
548 | .Ic brk | |
5c2bded5 | 549 | above) |
b750597e PB |
550 | is sent to the remote host. |
551 | The initial value for the quit character is taken to be | |
552 | the terminal's | |
b5dc1377 | 553 | .Ic quit |
b750597e | 554 | character. |
263cc8fc | 555 | .It Ic reprint |
b750597e | 556 | If |
b5dc1377 | 557 | .Nm telnet |
b750597e | 558 | is operating in |
263cc8fc | 559 | .Dv LINEMODE |
b5dc1377 | 560 | or \*(Lqold line by line\*(Lq mode, then this character is taken to |
b750597e | 561 | be the terminal's |
b5dc1377 | 562 | .Ic reprint |
b750597e PB |
563 | character. |
564 | The initial value for the reprint character is taken to be | |
565 | the terminal's | |
b5dc1377 | 566 | .Ic reprint |
b750597e | 567 | character. |
263cc8fc | 568 | .It Ic start |
b750597e | 569 | If the |
263cc8fc | 570 | .Dv TELNET TOGGLE-FLOW-CONTROL |
b750597e PB |
571 | option has been enabled, |
572 | then this character is taken to | |
573 | be the terminal's | |
b5dc1377 | 574 | .Ic start |
b750597e | 575 | character. |
5c2bded5 GM |
576 | The initial value for the kill character is taken to be |
577 | the terminal's | |
b5dc1377 | 578 | .Ic start |
5c2bded5 | 579 | character. |
263cc8fc | 580 | .It Ic stop |
b750597e | 581 | If the |
263cc8fc | 582 | .Dv TELNET TOGGLE-FLOW-CONTROL |
b750597e PB |
583 | option has been enabled, |
584 | then this character is taken to | |
585 | be the terminal's | |
b5dc1377 | 586 | .Ic stop |
b750597e PB |
587 | character. |
588 | The initial value for the kill character is taken to be | |
589 | the terminal's | |
b5dc1377 | 590 | .Ic stop |
b750597e | 591 | character. |
263cc8fc | 592 | .It Ic susp |
5c2bded5 | 593 | If |
b5dc1377 | 594 | .Nm telnet |
b750597e | 595 | is in |
b5dc1377 | 596 | .Ic localchars |
b750597e | 597 | mode, or |
263cc8fc | 598 | .Dv LINEMODE |
b750597e | 599 | is enabled, and the |
b5dc1377 | 600 | .Ic suspend |
b750597e | 601 | character is typed, a |
263cc8fc | 602 | .Dv TELNET SUSP |
b750597e | 603 | sequence (see |
b5dc1377 CL |
604 | .Ic send |
605 | .Ic susp | |
b750597e PB |
606 | above) |
607 | is sent to the remote host. | |
608 | The initial value for the suspend character is taken to be | |
609 | the terminal's | |
b5dc1377 | 610 | .Ic suspend |
b750597e | 611 | character. |
263cc8fc | 612 | .It Ic tracefile |
b5dc1377 CL |
613 | Thi is the file to which the output, caused by |
614 | .Ic netdata | |
615 | or | |
616 | .Ic option | |
263cc8fc CL |
617 | tracing being |
618 | .Dv TRUE , | |
619 | will be written. If it is set to | |
b5dc1377 | 620 | .Dq Fl , |
b750597e | 621 | then tracing information will be written to standard output (the default). |
263cc8fc | 622 | .It Ic worderase |
b750597e | 623 | If |
b5dc1377 | 624 | .Nm telnet |
b750597e | 625 | is operating in |
263cc8fc | 626 | .Dv LINEMODE |
b5dc1377 | 627 | or \*(Lqold line by line\*(Lq mode, then this character is taken to |
b750597e | 628 | be the terminal's |
b5dc1377 | 629 | .Ic worderase |
b750597e PB |
630 | character. |
631 | The initial value for the worderase character is taken to be | |
632 | the terminal's | |
b5dc1377 | 633 | .Ic worderase |
5c2bded5 | 634 | character. |
263cc8fc CL |
635 | .El |
636 | .It Ic slc Ar state | |
b750597e | 637 | The |
b5dc1377 | 638 | .Ic slc |
b750597e PB |
639 | command (Set Local Characters) is used to set |
640 | or change the state of the the special | |
b5dc1377 | 641 | characters when the |
263cc8fc | 642 | .Dv TELNET LINEMODE |
b5dc1377 | 643 | option has |
b750597e | 644 | been enabled. Special characters are characters that get |
b5dc1377 | 645 | mapped to |
263cc8fc | 646 | .Tn TELNET |
b5dc1377 CL |
647 | commands sequences (like |
648 | .Ic ip | |
b750597e | 649 | or |
b5dc1377 | 650 | .Ic quit ) |
b750597e | 651 | or line editing characters (like |
b5dc1377 | 652 | .Ic erase |
b750597e | 653 | and |
b5dc1377 | 654 | .Ic kill ) . |
b750597e | 655 | By default, the local special characters are exported. |
263cc8fc CL |
656 | .Bl -tag -width Fl |
657 | .It Ic export | |
b750597e PB |
658 | Switch to the local defaults for the special characters. The |
659 | local default characters are those of the local terminal at | |
660 | the time when | |
b5dc1377 | 661 | .Nm telnet |
b750597e | 662 | was started. |
263cc8fc | 663 | .It Ic import |
b750597e PB |
664 | Switch to the remote defaults for the special characters. |
665 | The remote default characters are those of the remote system | |
b5dc1377 | 666 | at the time when the |
263cc8fc | 667 | .Tn TELNET |
b5dc1377 | 668 | connection was established. |
263cc8fc | 669 | .It Ic check |
b750597e PB |
670 | Verify the current settings for the current special characters. |
671 | The remote side is requested to send all the current special | |
672 | character settings, and if there are any discrepencies with | |
673 | the local side, the local side will switch to the remote value. | |
5325ced3 | 674 | .Ic Ic \&? |
b750597e | 675 | Prints out help information for the |
b5dc1377 | 676 | .Ic slc |
b750597e | 677 | command. |
263cc8fc CL |
678 | .It Ic \&? |
679 | .El | |
680 | .It Ic toggle Ar arguments ... | |
5c2bded5 | 681 | Toggle (between |
263cc8fc | 682 | .Dv TRUE |
5c2bded5 | 683 | and |
263cc8fc | 684 | .Dv FALSE ) |
5c2bded5 | 685 | various flags that control how |
b5dc1377 | 686 | .Nm telnet |
5c2bded5 | 687 | responds to events. |
263cc8fc CL |
688 | These flags may be set explicitly to |
689 | .Dv TRUE | |
690 | or | |
691 | .Dv FALSE | |
b750597e | 692 | using the |
b5dc1377 | 693 | .Ic set |
b750597e | 694 | and |
b5dc1377 | 695 | .Ic unset |
b750597e | 696 | commands listed above. |
5c2bded5 | 697 | More than one argument may be specified. |
349a83e1 | 698 | The state of these flags may be interrogated with the |
b5dc1377 | 699 | .Ic display |
349a83e1 | 700 | command. |
5c2bded5 | 701 | Valid arguments are: |
263cc8fc CL |
702 | .Bl -tag -width Ar |
703 | .It Ic autoflush | |
5c2bded5 | 704 | If |
b5dc1377 | 705 | .Ic autoflush |
5c2bded5 | 706 | and |
b5dc1377 | 707 | .Ic localchars |
5c2bded5 | 708 | are both |
263cc8fc | 709 | .Dv TRUE , |
5c2bded5 | 710 | then when the |
b5dc1377 | 711 | .Ic ao , |
5c2bded5 | 712 | or |
b5dc1377 | 713 | .Ic quit |
5c2bded5 | 714 | characters are recognized (and transformed into |
263cc8fc | 715 | .Tn TELNET |
5c2bded5 | 716 | sequences; see |
b5dc1377 | 717 | .Ic set |
5c2bded5 | 718 | above for details), |
b5dc1377 | 719 | .Nm telnet |
5c2bded5 GM |
720 | refuses to display any data on the user's terminal |
721 | until the remote system acknowledges (via a | |
263cc8fc | 722 | .Dv TELNET TIMING MARK |
5c2bded5 GM |
723 | option) |
724 | that it has processed those | |
263cc8fc | 725 | .Tn TELNET |
5c2bded5 | 726 | sequences. |
263cc8fc CL |
727 | The initial value for this toggle is |
728 | .Dv TRUE | |
729 | if the terminal user had not | |
730 | done an "stty noflsh", otherwise | |
731 | .Dv FALSE | |
732 | (see | |
b5dc1377 | 733 | .Xr stty 1 ) . |
263cc8fc | 734 | .It Ic autosynch |
349a83e1 | 735 | If |
b5dc1377 | 736 | .Ic autosynch |
349a83e1 | 737 | and |
b5dc1377 | 738 | .Ic localchars |
349a83e1 | 739 | are both |
263cc8fc | 740 | .Dv TRUE , |
349a83e1 | 741 | then when either the |
b5dc1377 | 742 | .Ic intr |
349a83e1 | 743 | or |
b5dc1377 | 744 | .Ic quit |
349a83e1 | 745 | characters is typed (see |
b5dc1377 | 746 | .Ic set |
349a83e1 | 747 | above for descriptions of the |
b5dc1377 | 748 | .Ic intr |
349a83e1 | 749 | and |
b5dc1377 | 750 | .Ic quit |
349a83e1 | 751 | characters), the resulting |
263cc8fc | 752 | .Tn TELNET |
349a83e1 | 753 | sequence sent is followed by the |
263cc8fc | 754 | .Dv TELNET SYNCH |
349a83e1 MK |
755 | sequence. |
756 | This procedure | |
b5dc1377 | 757 | .Ic should |
349a83e1 MK |
758 | cause the remote system to begin throwing away all previously |
759 | typed input until both of the | |
263cc8fc | 760 | .Tn TELNET |
349a83e1 | 761 | sequences have been read and acted upon. |
263cc8fc CL |
762 | The initial value of this toggle is |
763 | .Dv FALSE . | |
764 | .It Ic binary | |
b750597e | 765 | Enable or disable the |
263cc8fc | 766 | .Dv TELNET BINARY |
6570c863 | 767 | option on both input and output. |
263cc8fc | 768 | .It Ic inbinary |
6570c863 | 769 | Enable or disable the |
263cc8fc | 770 | .Dv TELNET BINARY |
6570c863 | 771 | option on input. |
263cc8fc | 772 | .It Ic outbinary |
6570c863 | 773 | Enable or disable the |
263cc8fc | 774 | .Dv TELNET BINARY |
6570c863 | 775 | option on output. |
263cc8fc CL |
776 | .It Ic crlf |
777 | If this is | |
778 | .Dv TRUE , | |
779 | then carriage returns will be sent as | |
780 | .Li <CR><LF> . | |
781 | If this is | |
782 | .Dv FALSE , | |
783 | then carriage returns will be send as | |
784 | .Li <CR><NUL> . | |
785 | The initial value for this toggle is | |
786 | .Dv FALSE . | |
787 | .It Ic crmod | |
5c2bded5 GM |
788 | Toggle carriage return mode. |
789 | When this mode is enabled, most carriage return characters received from | |
790 | the remote host will be mapped into a carriage return followed by | |
791 | a line feed. | |
792 | This mode does not affect those characters typed by the user, only | |
793 | those received from the remote host. | |
794 | This mode is not very useful unless the remote host | |
795 | only sends carriage return, but never line feed. | |
263cc8fc CL |
796 | The initial value for this toggle is |
797 | .Dv FALSE . | |
798 | .It Ic debug | |
5c2bded5 | 799 | Toggles socket level debugging (useful only to the |
b5dc1377 | 800 | .Ic super user ) . |
263cc8fc CL |
801 | The initial value for this toggle is |
802 | .Dv FALSE . | |
803 | .It Ic localchars | |
b750597e | 804 | If this is |
263cc8fc | 805 | .Dv TRUE , |
b750597e | 806 | then the |
b5dc1377 CL |
807 | .Ic flush , |
808 | .Ic quit , | |
b750597e | 809 | and |
b5dc1377 | 810 | .Ic kill |
b750597e | 811 | characters (see |
b5dc1377 | 812 | .Ic set |
b750597e | 813 | above) are recognized locally, and transformed into (hopefully) appropriate |
263cc8fc | 814 | .Tn TELNET |
b750597e PB |
815 | control sequences |
816 | (respectively | |
b5dc1377 CL |
817 | .Ic ao , |
818 | .Ic brk , | |
b750597e | 819 | and |
b5dc1377 | 820 | .Ic el ; |
b750597e | 821 | see |
b5dc1377 | 822 | .Ic send |
b750597e | 823 | above). |
263cc8fc CL |
824 | The initial value for this toggle is |
825 | .Dv TRUE | |
826 | in \*(Lqold line by line\*(Rq mode, | |
827 | and | |
828 | .Dv FALSE | |
829 | in \*(Lqcharacter at a time\*(Rq mode. | |
b750597e | 830 | When the |
263cc8fc | 831 | .Dv LINEMODE |
b750597e | 832 | option is enabled, the value of |
b5dc1377 | 833 | .Ic localchars |
263cc8fc CL |
834 | is ignored, and assumed to always be |
835 | .Dv TRUE . | |
b750597e | 836 | If |
263cc8fc | 837 | .Dv LINEMODE |
b750597e | 838 | has ever been enabled, then |
b5dc1377 | 839 | .Ic quit |
b750597e | 840 | is sent as |
b5dc1377 | 841 | .Ic abort , |
b750597e | 842 | and |
b5dc1377 | 843 | .Ic eof and |
b750597e PB |
844 | .B suspend |
845 | are sent as | |
b5dc1377 | 846 | .Ic eof and |
b750597e | 847 | see |
b5dc1377 | 848 | .Ic send |
b750597e | 849 | above). |
263cc8fc | 850 | .It Ic netdata |
b750597e | 851 | Toggles the display of all network data (in hexadecimal format). |
263cc8fc CL |
852 | The initial value for this toggle is |
853 | .Dv FALSE . | |
854 | .It Ic options | |
5c2bded5 | 855 | Toggles the display of some internal |
b5dc1377 | 856 | .Nm telnet |
5c2bded5 | 857 | protocol processing (having to do with |
263cc8fc | 858 | .Tn TELNET |
5c2bded5 | 859 | options). |
263cc8fc CL |
860 | The initial value for this toggle is |
861 | .Dv FALSE . | |
862 | .It Ic prettydump | |
b750597e | 863 | When the |
b5dc1377 | 864 | .Ic netdata |
b750597e | 865 | toggle is enabled, if |
b5dc1377 | 866 | .Ic prettydump |
b750597e | 867 | is enabled the output from the |
b5dc1377 | 868 | .Ic netdata |
b750597e PB |
869 | command will be formated in a more user readable format. |
870 | Spaces are put between each character in the output, and the | |
871 | begining of any | |
263cc8fc | 872 | .Tn TELNET |
b750597e | 873 | escape sequence is preceeded by a '*' to aid in locating them. |
263cc8fc | 874 | .It Ic \&? |
5c2bded5 | 875 | Displays the legal |
b5dc1377 | 876 | .Ic toggle |
5c2bded5 | 877 | commands. |
263cc8fc CL |
878 | .El |
879 | .It Ic z | |
b750597e | 880 | Suspend |
b5dc1377 CL |
881 | .Nm telnet . |
882 | This command only works when the user is using the | |
883 | .Xr csh 1 . | |
263cc8fc | 884 | .It Ic \&! Op Ar command |
b750597e | 885 | Execute a single command in a subshell on the local |
b5dc1377 CL |
886 | system. If |
887 | .Ic command | |
888 | is ommitted, then an interactive | |
b750597e | 889 | subshell is invoked. |
263cc8fc | 890 | .It Ic status |
b5dc1377 CL |
891 | Show the current status of |
892 | .Nm telnet . | |
b750597e PB |
893 | This includes the peer one is connected to, as well |
894 | as the current mode. | |
263cc8fc | 895 | .It Ic \&? Op Ar command |
b750597e | 896 | Get help. With no arguments, |
b5dc1377 | 897 | .Nm telnet |
b750597e | 898 | prints a help summary. |
b5dc1377 CL |
899 | If a command is specified, |
900 | .Nm telnet | |
b750597e | 901 | will print the help information for just that command. |
263cc8fc | 902 | .El |
b5dc1377 CL |
903 | .Sh ENVIRONMENT |
904 | .Nm Telnet | |
5325ced3 | 905 | uses the |
b5dc1377 | 906 | .Ev HOME , |
5325ced3 | 907 | .Ev SHELL |
b5dc1377 CL |
908 | and |
909 | .Ev TERM | |
910 | environent variables. | |
911 | .Sh FILES | |
263cc8fc CL |
912 | .Bl -tag -width ~/.telnetrc -compact |
913 | .It Pa ~/.telnetrc | |
b5dc1377 | 914 | user customized telnet startup values |
263cc8fc | 915 | .El |
b5dc1377 | 916 | .Sh HISTORY |
263cc8fc | 917 | The |
b5dc1377 | 918 | .Nm Telnet |
263cc8fc CL |
919 | command appeared in |
920 | .Bx 4.2 . | |
b5dc1377 CL |
921 | .Sh NOTES |
922 | .Pp | |
5c2bded5 | 923 | On some remote systems, echo has to be turned off manually when in |
b5dc1377 CL |
924 | \*(Lqold line by line\*(Rq mode. |
925 | .Pp | |
926 | In \*(Lqold line by line\*(Rq mode or | |
263cc8fc | 927 | .Dv LINEMODE |
b5dc1377 CL |
928 | the terminal's |
929 | .Ic eof | |
5c2bded5 GM |
930 | character is only recognized (and sent to the remote system) |
931 | when it is the first character on a line. |