Annotation of src/usr.bin/ssh/ssh.1, Revision 1.47
1.1 deraadt 1: .\" -*- nroff -*-
2: .\"
3: .\" ssh.1.in
4: .\"
5: .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
6: .\"
7: .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8: .\" All rights reserved
9: .\"
10: .\" Created: Sat Apr 22 21:55:14 1995 ylo
11: .\"
1.47 ! markus 12: .\" $Id: ssh.1,v 1.7 2000/04/18 15:01:32 markus Exp $
1.1 deraadt 13: .\"
1.2 deraadt 14: .Dd September 25, 1999
15: .Dt SSH 1
16: .Os
17: .Sh NAME
18: .Nm ssh
1.20 provos 19: .Nd OpenSSH secure shell client (remote login program)
1.2 deraadt 20: .Sh SYNOPSIS
21: .Nm ssh
22: .Op Fl l Ar login_name
1.5 deraadt 23: .Op Ar hostname | user@hostname
1.2 deraadt 24: .Op Ar command
25: .Pp
26: .Nm ssh
1.46 markus 27: .Op Fl afgknqtvxCPX246
1.12 aaron 28: .Op Fl c Ar blowfish | 3des
1.2 deraadt 29: .Op Fl e Ar escape_char
30: .Op Fl i Ar identity_file
31: .Op Fl l Ar login_name
32: .Op Fl o Ar option
33: .Op Fl p Ar port
1.12 aaron 34: .Oo Fl L Xo
35: .Sm off
1.33 markus 36: .Ar port :
1.12 aaron 37: .Ar host :
38: .Ar hostport
39: .Sm on
40: .Xc
41: .Oc
42: .Oo Fl R Xo
43: .Sm off
1.33 markus 44: .Ar port :
1.12 aaron 45: .Ar host :
46: .Ar hostport
47: .Sm on
48: .Xc
49: .Oc
1.5 deraadt 50: .Op Ar hostname | user@hostname
1.2 deraadt 51: .Op Ar command
1.44 aaron 52: .Sh DESCRIPTION
1.2 deraadt 53: .Nm
1.5 deraadt 54: (Secure Shell) is a program for logging into a remote machine and for
1.40 aaron 55: executing commands on a remote machine.
56: It is intended to replace
1.1 deraadt 57: rlogin and rsh, and provide secure encrypted communications between
1.40 aaron 58: two untrusted hosts over an insecure network.
59: X11 connections and
1.1 deraadt 60: arbitrary TCP/IP ports can also be forwarded over the secure channel.
1.2 deraadt 61: .Pp
62: .Nm
1.44 aaron 63: connects and logs into the specified
1.2 deraadt 64: .Ar hostname .
1.1 deraadt 65: The user must prove
66: his/her identity to the remote machine using one of several methods.
1.2 deraadt 67: .Pp
1.1 deraadt 68: First, if the machine the user logs in from is listed in
1.2 deraadt 69: .Pa /etc/hosts.equiv
1.1 deraadt 70: or
1.2 deraadt 71: .Pa /etc/shosts.equiv
1.1 deraadt 72: on the remote machine, and the user names are
73: the same on both sides, the user is immediately permitted to log in.
1.44 aaron 74: Second, if
1.2 deraadt 75: .Pa \&.rhosts
1.1 deraadt 76: or
1.2 deraadt 77: .Pa \&.shosts
1.1 deraadt 78: exists in the user's home directory on the
79: remote machine and contains a line containing the name of the client
80: machine and the name of the user on that machine, the user is
1.40 aaron 81: permitted to log in.
82: This form of authentication alone is normally not
1.1 deraadt 83: allowed by the server because it is not secure.
1.2 deraadt 84: .Pp
1.1 deraadt 85: The second (and primary) authentication method is the
1.2 deraadt 86: .Pa rhosts
1.1 deraadt 87: or
1.2 deraadt 88: .Pa hosts.equiv
1.40 aaron 89: method combined with RSA-based host authentication.
90: It means that if the login would be permitted by
1.2 deraadt 91: .Pa \&.rhosts ,
92: .Pa \&.shosts ,
93: .Pa /etc/hosts.equiv ,
1.1 deraadt 94: or
1.2 deraadt 95: .Pa /etc/shosts.equiv ,
1.11 deraadt 96: and if additionally the server can verify the client's
1.44 aaron 97: host key (see
1.2 deraadt 98: .Pa /etc/ssh_known_hosts
1.23 markus 99: and
100: .Pa $HOME/.ssh/known_hosts
1.1 deraadt 101: in the
1.2 deraadt 102: .Sx FILES
1.40 aaron 103: section), only then login is permitted.
104: This authentication method closes security holes due to IP
105: spoofing, DNS spoofing and routing spoofing.
106: [Note to the administrator:
1.2 deraadt 107: .Pa /etc/hosts.equiv ,
108: .Pa \&.rhosts ,
1.1 deraadt 109: and the rlogin/rsh protocol in general, are inherently insecure and should be
110: disabled if security is desired.]
1.2 deraadt 111: .Pp
1.44 aaron 112: As a third authentication method,
1.2 deraadt 113: .Nm
1.1 deraadt 114: supports RSA based authentication.
115: The scheme is based on public-key cryptography: there are cryptosystems
116: where encryption and decryption are done using separate keys, and it
117: is not possible to derive the decryption key from the encryption key.
1.40 aaron 118: RSA is one such system.
1.44 aaron 119: The idea is that each user creates a public/private
1.40 aaron 120: key pair for authentication purposes.
121: The server knows the public key, and only the user knows the private key.
1.44 aaron 122: The file
1.2 deraadt 123: .Pa $HOME/.ssh/authorized_keys
1.1 deraadt 124: lists the public keys that are permitted for logging
1.40 aaron 125: in.
126: When the user logs in, the
1.2 deraadt 127: .Nm
1.1 deraadt 128: program tells the server which key pair it would like to use for
1.40 aaron 129: authentication.
130: The server checks if this key is permitted, and if
1.1 deraadt 131: so, sends the user (actually the
1.2 deraadt 132: .Nm
1.1 deraadt 133: program running on behalf of the user) a challenge, a random number,
1.40 aaron 134: encrypted by the user's public key.
135: The challenge can only be
136: decrypted using the proper private key.
137: The user's client then decrypts the
1.1 deraadt 138: challenge using the private key, proving that he/she knows the private
139: key but without disclosing it to the server.
1.2 deraadt 140: .Pp
141: .Nm
1.40 aaron 142: implements the RSA authentication protocol automatically.
143: The user creates his/her RSA key pair by running
1.2 deraadt 144: .Xr ssh-keygen 1 .
1.44 aaron 145: This stores the private key in
1.2 deraadt 146: .Pa \&.ssh/identity
1.1 deraadt 147: and the public key in
1.2 deraadt 148: .Pa \&.ssh/identity.pub
1.40 aaron 149: in the user's home directory.
150: The user should then copy the
1.2 deraadt 151: .Pa identity.pub
1.44 aaron 152: to
1.2 deraadt 153: .Pa \&.ssh/authorized_keys
1.44 aaron 154: in his/her home directory on the remote machine (the
1.2 deraadt 155: .Pa authorized_keys
1.44 aaron 156: file corresponds to the conventional
1.2 deraadt 157: .Pa \&.rhosts
1.1 deraadt 158: file, and has one key
1.40 aaron 159: per line, though the lines can be very long).
160: After this, the user can log in without giving the password.
161: RSA authentication is much
1.1 deraadt 162: more secure than rhosts authentication.
1.2 deraadt 163: .Pp
1.1 deraadt 164: The most convenient way to use RSA authentication may be with an
1.40 aaron 165: authentication agent.
166: See
1.2 deraadt 167: .Xr ssh-agent 1
1.1 deraadt 168: for more information.
1.2 deraadt 169: .Pp
1.44 aaron 170: If other authentication methods fail,
1.2 deraadt 171: .Nm
1.40 aaron 172: prompts the user for a password.
173: The password is sent to the remote
1.1 deraadt 174: host for checking; however, since all communications are encrypted,
175: the password cannot be seen by someone listening on the network.
1.2 deraadt 176: .Pp
1.1 deraadt 177: When the user's identity has been accepted by the server, the server
178: either executes the given command, or logs into the machine and gives
1.40 aaron 179: the user a normal shell on the remote machine.
180: All communication with
1.1 deraadt 181: the remote command or shell will be automatically encrypted.
1.2 deraadt 182: .Pp
1.1 deraadt 183: If a pseudo-terminal has been allocated (normal login session), the
1.2 deraadt 184: user can disconnect with
185: .Ic ~. ,
186: and suspend
187: .Nm
188: with
189: .Ic ~^Z .
190: All forwarded connections can be listed with
1.44 aaron 191: .Ic ~#
1.2 deraadt 192: and if
1.1 deraadt 193: the session blocks waiting for forwarded X11 or TCP/IP
1.2 deraadt 194: connections to terminate, it can be backgrounded with
195: .Ic ~&
196: (this should not be used while the user shell is active, as it can cause the
1.40 aaron 197: shell to hang).
198: All available escapes can be listed with
1.2 deraadt 199: .Ic ~? .
200: .Pp
201: A single tilde character can be sent as
202: .Ic ~~
203: (or by following the tilde by a character other than those described above).
1.1 deraadt 204: The escape character must always follow a newline to be interpreted as
1.40 aaron 205: special.
206: The escape character can be changed in configuration files
207: or on the command line.
1.2 deraadt 208: .Pp
1.1 deraadt 209: If no pseudo tty has been allocated, the
210: session is transparent and can be used to reliably transfer binary
1.40 aaron 211: data.
212: On most systems, setting the escape character to
1.2 deraadt 213: .Dq none
214: will also make the session transparent even if a tty is used.
215: .Pp
1.1 deraadt 216: The session terminates when the command or shell in on the remote
217: machine exists and all X11 and TCP/IP connections have been closed.
218: The exit status of the remote program is returned as the exit status
219: of
1.2 deraadt 220: .Nm ssh .
221: .Pp
1.1 deraadt 222: If the user is using X11 (the
1.2 deraadt 223: .Ev DISPLAY
1.1 deraadt 224: environment variable is set), the connection to the X11 display is
225: automatically forwarded to the remote side in such a way that any X11
226: programs started from the shell (or command) will go through the
227: encrypted channel, and the connection to the real X server will be made
1.40 aaron 228: from the local machine.
229: The user should not manually set
1.2 deraadt 230: .Ev DISPLAY .
1.1 deraadt 231: Forwarding of X11 connections can be
232: configured on the command line or in configuration files.
1.2 deraadt 233: .Pp
234: The
1.44 aaron 235: .Ev DISPLAY
1.2 deraadt 236: value set by
237: .Nm
1.1 deraadt 238: will point to the server machine, but with a display number greater
1.40 aaron 239: than zero.
240: This is normal, and happens because
1.2 deraadt 241: .Nm
242: creates a
243: .Dq proxy
244: X server on the server machine for forwarding the
1.1 deraadt 245: connections over the encrypted channel.
1.2 deraadt 246: .Pp
247: .Nm
1.1 deraadt 248: will also automatically set up Xauthority data on the server machine.
249: For this purpose, it will generate a random authorization cookie,
250: store it in Xauthority on the server, and verify that any forwarded
251: connections carry this cookie and replace it by the real cookie when
1.40 aaron 252: the connection is opened.
253: The real authentication cookie is never
1.1 deraadt 254: sent to the server machine (and no cookies are sent in the plain).
1.2 deraadt 255: .Pp
1.1 deraadt 256: If the user is using an authentication agent, the connection to the agent
257: is automatically forwarded to the remote side unless disabled on
258: command line or in a configuration file.
1.2 deraadt 259: .Pp
1.1 deraadt 260: Forwarding of arbitrary TCP/IP connections over the secure channel can
1.40 aaron 261: be specified either on command line or in a configuration file.
262: One possible application of TCP/IP forwarding is a secure connection to an
1.1 deraadt 263: electronic purse; another is going trough firewalls.
1.2 deraadt 264: .Pp
265: .Nm
1.1 deraadt 266: automatically maintains and checks a database containing RSA-based
1.40 aaron 267: identifications for all hosts it has ever been used with.
1.44 aaron 268: The database is stored in
1.2 deraadt 269: .Pa \&.ssh/known_hosts
1.40 aaron 270: in the user's home directory.
1.44 aaron 271: Additionally, the file
1.2 deraadt 272: .Pa /etc/ssh_known_hosts
1.40 aaron 273: is automatically checked for known hosts.
274: Any new hosts are automatically added to the user's file.
275: If a host's identification
1.1 deraadt 276: ever changes,
1.2 deraadt 277: .Nm
1.1 deraadt 278: warns about this and disables password authentication to prevent a
1.40 aaron 279: trojan horse from getting the user's password.
280: Another purpose of
1.1 deraadt 281: this mechanism is to prevent man-in-the-middle attacks which could
1.40 aaron 282: otherwise be used to circumvent the encryption.
283: The
1.2 deraadt 284: .Cm StrictHostKeyChecking
1.1 deraadt 285: option (see below) can be used to prevent logins to machines whose
286: host key is not known or has changed.
1.2 deraadt 287: .Sh OPTIONS
288: .Bl -tag -width Ds
1.4 dugsong 289: .It Fl a
1.42 aaron 290: Disables forwarding of the authentication agent connection.
291: This may also be specified on a per-host basis in the configuration file.
1.6 deraadt 292: .It Fl c Ar blowfish|3des
1.44 aaron 293: Selects the cipher to use for encrypting the session.
1.2 deraadt 294: .Ar 3des
1.40 aaron 295: is used by default.
1.44 aaron 296: It is believed to be secure.
1.5 deraadt 297: .Ar 3des
298: (triple-des) is an encrypt-decrypt-encrypt triple with three different keys.
299: It is presumably more secure than the
1.2 deraadt 300: .Ar des
1.5 deraadt 301: cipher which is no longer supported in ssh.
302: .Ar blowfish
303: is a fast block cipher, it appears very secure and is much faster than
1.40 aaron 304: .Ar 3des .
1.2 deraadt 305: .It Fl e Ar ch|^ch|none
306: Sets the escape character for sessions with a pty (default:
307: .Ql ~ ) .
1.40 aaron 308: The escape character is only recognized at the beginning of a line.
309: The escape character followed by a dot
1.2 deraadt 310: .Pq Ql \&.
311: closes the connection, followed
1.1 deraadt 312: by control-Z suspends the connection, and followed by itself sends the
1.40 aaron 313: escape character once.
314: Setting the character to
1.2 deraadt 315: .Dq none
316: disables any escapes and makes the session fully transparent.
317: .It Fl f
318: Requests
319: .Nm
1.40 aaron 320: to go to background just before command execution.
321: This is useful if
1.2 deraadt 322: .Nm
323: is going to ask for passwords or passphrases, but the user
1.40 aaron 324: wants it in the background.
1.44 aaron 325: This implies
1.2 deraadt 326: .Fl n .
1.1 deraadt 327: The recommended way to start X11 programs at a remote site is with
1.2 deraadt 328: something like
329: .Ic ssh -f host xterm .
1.34 markus 330: .It Fl g
331: Allows remote hosts to connect to local forwarded ports.
1.2 deraadt 332: .It Fl i Ar identity_file
1.44 aaron 333: Selects the file from which the identity (private key) for
1.40 aaron 334: RSA authentication is read.
1.44 aaron 335: Default is
1.2 deraadt 336: .Pa \&.ssh/identity
1.40 aaron 337: in the user's home directory.
338: Identity files may also be specified on
339: a per-host basis in the configuration file.
340: It is possible to have multiple
1.2 deraadt 341: .Fl i
342: options (and multiple identities specified in
1.1 deraadt 343: configuration files).
1.2 deraadt 344: .It Fl k
1.42 aaron 345: Disables forwarding of Kerberos tickets and AFS tokens.
346: This may also be specified on a per-host basis in the configuration file.
1.2 deraadt 347: .It Fl l Ar login_name
1.40 aaron 348: Specifies the user to log in as on the remote machine.
349: This also may be specified on a per-host basis in the configuration file.
1.2 deraadt 350: .It Fl n
351: Redirects stdin from
352: .Pa /dev/null
353: (actually, prevents reading from stdin).
1.1 deraadt 354: This must be used when
1.2 deraadt 355: .Nm
1.40 aaron 356: is run in the background.
357: A common trick is to use this to run X11 programs on a remote machine.
358: For example,
1.2 deraadt 359: .Ic ssh -n shadows.cs.hut.fi emacs &
360: will start an emacs on shadows.cs.hut.fi, and the X11
1.1 deraadt 361: connection will be automatically forwarded over an encrypted channel.
362: The
1.2 deraadt 363: .Nm
1.1 deraadt 364: program will be put in the background.
365: (This does not work if
1.2 deraadt 366: .Nm
367: needs to ask for a password or passphrase; see also the
368: .Fl f
369: option.)
370: .It Fl o Ar option
1.1 deraadt 371: Can be used to give options in the format used in the config file.
372: This is useful for specifying options for which there is no separate
1.40 aaron 373: command-line flag.
374: The option has the same format as a line in the configuration file.
1.2 deraadt 375: .It Fl p Ar port
1.40 aaron 376: Port to connect to on the remote host.
377: This can be specified on a
1.1 deraadt 378: per-host basis in the configuration file.
1.16 markus 379: .It Fl P
380: Use a non-privileged port for outgoing connections.
381: This can be used if your firewall does
382: not permit connections from privileged ports.
1.30 provos 383: Note that this option turns off
1.16 markus 384: .Cm RhostsAuthentication
385: and
386: .Cm RhostsRSAAuthentication .
1.2 deraadt 387: .It Fl q
1.40 aaron 388: Quiet mode.
389: Causes all warning and diagnostic messages to be suppressed.
390: Only fatal errors are displayed.
1.2 deraadt 391: .It Fl t
1.40 aaron 392: Force pseudo-tty allocation.
1.43 brad 393: This can be used to execute arbitrary
1.40 aaron 394: screen-based programs on a remote machine, which can be very useful,
395: e.g., when implementing menu services.
1.2 deraadt 396: .It Fl v
1.40 aaron 397: Verbose mode.
398: Causes
1.2 deraadt 399: .Nm
1.40 aaron 400: to print debugging messages about its progress.
401: This is helpful in
1.1 deraadt 402: debugging connection, authentication, and configuration problems.
1.22 provos 403: The verbose mode is also used to display
404: .Xr skey 1
405: challenges, if the user entered "s/key" as password.
1.2 deraadt 406: .It Fl x
1.40 aaron 407: Disables X11 forwarding.
408: This can also be specified on a per-host basis in a configuration file.
1.2 deraadt 409: .It Fl X
1.1 deraadt 410: Enables X11 forwarding.
1.2 deraadt 411: .It Fl C
1.1 deraadt 412: Requests compression of all data (including stdin, stdout, stderr, and
1.40 aaron 413: data for forwarded X11 and TCP/IP connections).
414: The compression algorithm is the same used by
1.34 markus 415: .Xr gzip 1 ,
416: and the
1.2 deraadt 417: .Dq level
418: can be controlled by the
419: .Cm CompressionLevel
1.40 aaron 420: option (see below).
421: Compression is desirable on modem lines and other
1.1 deraadt 422: slow connections, but will only slow down things on fast networks.
423: The default value can be set on a host-by-host basis in the
424: configuration files; see the
1.2 deraadt 425: .Cm Compress
1.1 deraadt 426: option below.
1.2 deraadt 427: .It Fl L Ar port:host:hostport
1.1 deraadt 428: Specifies that the given port on the local (client) host is to be
1.40 aaron 429: forwarded to the given host and port on the remote side.
430: This works by allocating a socket to listen to
1.2 deraadt 431: .Ar port
1.1 deraadt 432: on the local side, and whenever a connection is made to this port, the
433: connection is forwarded over the secure channel, and a connection is
434: made to
1.32 markus 435: .Ar host
436: port
437: .Ar hostport
1.40 aaron 438: from the remote machine.
439: Port forwardings can also be specified in the configuration file.
440: Only root can forward privileged ports.
1.32 markus 441: IPv6 addresses can be specified with an alternative syntax:
442: .Ar port/host/hostport
1.2 deraadt 443: .It Fl R Ar port:host:hostport
1.1 deraadt 444: Specifies that the given port on the remote (server) host is to be
1.40 aaron 445: forwarded to the given host and port on the local side.
446: This works by allocating a socket to listen to
1.2 deraadt 447: .Ar port
1.1 deraadt 448: on the remote side, and whenever a connection is made to this port, the
449: connection is forwarded over the secure channel, and a connection is
450: made to
1.32 markus 451: .Ar host
452: port
453: .Ar hostport
1.40 aaron 454: from the local machine.
455: Port forwardings can also be specified in the configuration file.
456: Privileged ports can be forwarded only when
1.1 deraadt 457: logging in as root on the remote machine.
1.46 markus 458: .It Fl 2
459: Forces
460: .Nm
461: to use protocol version 2 only.
1.32 markus 462: .It Fl 4
463: Forces
464: .Nm
465: to use IPv4 addresses only.
466: .It Fl 6
467: Forces
468: .Nm
469: to use IPv6 addresses only.
1.2 deraadt 470: .El
471: .Sh CONFIGURATION FILES
472: .Nm
1.1 deraadt 473: obtains configuration data from the following sources (in this order):
474: command line options, user's configuration file
1.2 deraadt 475: .Pq Pa $HOME/.ssh/config ,
476: and system-wide configuration file
477: .Pq Pa /etc/ssh_config .
478: For each parameter, the first obtained value
1.40 aaron 479: will be used.
480: The configuration files contain sections bracketed by
481: .Dq Host
482: specifications, and that section is only applied for hosts that
483: match one of the patterns given in the specification.
484: The matched host name is the one given on the command line.
1.2 deraadt 485: .Pp
1.1 deraadt 486: Since the first obtained value for each parameter is used, more
487: host-specific declarations should be given near the beginning of the
488: file, and general defaults at the end.
1.2 deraadt 489: .Pp
1.1 deraadt 490: The configuration file has the following format:
1.2 deraadt 491: .Pp
492: Empty lines and lines starting with
493: .Ql #
494: are comments.
495: .Pp
496: Otherwise a line is of the format
497: .Dq keyword arguments .
498: The possible
1.1 deraadt 499: keywords and their meanings are as follows (note that the
500: configuration files are case-sensitive):
1.2 deraadt 501: .Bl -tag -width Ds
502: .It Cm Host
1.1 deraadt 503: Restricts the following declarations (up to the next
1.2 deraadt 504: .Cm Host
1.1 deraadt 505: keyword) to be only for those hosts that match one of the patterns
1.2 deraadt 506: given after the keyword.
507: .Ql \&*
508: and
509: .Ql ?
510: can be used as wildcards in the
1.40 aaron 511: patterns.
512: A single
1.2 deraadt 513: .Ql \&*
514: as a pattern can be used to provide global
1.40 aaron 515: defaults for all hosts.
516: The host is the
1.2 deraadt 517: .Ar hostname
1.1 deraadt 518: argument given on the command line (i.e., the name is not converted to
519: a canonicalized host name before matching).
1.2 deraadt 520: .It Cm AFSTokenPassing
1.42 aaron 521: Specifies whether to pass AFS tokens to remote host.
522: The argument to this keyword must be
1.2 deraadt 523: .Dq yes
524: or
525: .Dq no .
526: .It Cm BatchMode
527: If set to
528: .Dq yes ,
1.40 aaron 529: passphrase/password querying will be disabled.
530: This option is useful in scripts and other batch jobs where you have no
531: user to supply the password.
532: The argument must be
1.2 deraadt 533: .Dq yes
534: or
535: .Dq no .
1.34 markus 536: .It Cm CheckHostIP
537: If this flag is set to
538: .Dq yes ,
539: ssh will additionally check the host ip address in the
540: .Pa known_hosts
1.42 aaron 541: file.
542: This allows ssh to detect if a host key changed due to DNS spoofing.
1.34 markus 543: If the option is set to
544: .Dq no ,
545: the check will not be executed.
1.2 deraadt 546: .It Cm Cipher
1.40 aaron 547: Specifies the cipher to use for encrypting the session.
548: Currently,
1.2 deraadt 549: .Dq blowfish ,
1.1 deraadt 550: and
1.10 provos 551: .Dq 3des
1.40 aaron 552: are supported.
553: The default is
1.2 deraadt 554: .Dq 3des .
1.45 markus 555: .It Cm Ciphers
556: Specifies the ciphers allowed for protocol version 2
557: in order of preference.
558: Multiple ciphers must be comma-separated.
559: The default is
560: .Dq blowfish-cbc,3des-cbc,arcfour,cast128-cbc .
1.2 deraadt 561: .It Cm Compression
1.40 aaron 562: Specifies whether to use compression.
563: The argument must be
1.2 deraadt 564: .Dq yes
565: or
566: .Dq no .
567: .It Cm CompressionLevel
1.40 aaron 568: Specifies the compression level to use if compression is enable.
569: The argument must be an integer from 1 (fast) to 9 (slow, best).
570: The default level is 6, which is good for most applications.
571: The meaning of the values is the same as in
1.34 markus 572: .Xr gzip 1 .
1.2 deraadt 573: .It Cm ConnectionAttempts
1.1 deraadt 574: Specifies the number of tries (one per second) to make before falling
1.40 aaron 575: back to rsh or exiting.
576: The argument must be an integer.
577: This may be useful in scripts if the connection sometimes fails.
1.2 deraadt 578: .It Cm EscapeChar
579: Sets the escape character (default:
580: .Ql ~ ) .
581: The escape character can also
1.40 aaron 582: be set on the command line.
583: The argument should be a single character,
1.2 deraadt 584: .Ql ^
585: followed by a letter, or
586: .Dq none
587: to disable the escape
1.1 deraadt 588: character entirely (making the connection transparent for binary
589: data).
1.44 aaron 590: .It Cm FallBackToRsh
1.1 deraadt 591: Specifies that if connecting via
1.2 deraadt 592: .Nm
1.1 deraadt 593: fails due to a connection refused error (there is no
1.2 deraadt 594: .Xr sshd 8
1.44 aaron 595: listening on the remote host),
1.2 deraadt 596: .Xr rsh 1
1.1 deraadt 597: should automatically be used instead (after a suitable warning about
1.40 aaron 598: the session being unencrypted).
599: The argument must be
1.2 deraadt 600: .Dq yes
601: or
602: .Dq no .
603: .It Cm ForwardAgent
1.1 deraadt 604: Specifies whether the connection to the authentication agent (if any)
1.40 aaron 605: will be forwarded to the remote machine.
606: The argument must be
1.2 deraadt 607: .Dq yes
608: or
609: .Dq no .
610: .It Cm ForwardX11
1.1 deraadt 611: Specifies whether X11 connections will be automatically redirected
1.44 aaron 612: over the secure channel and
1.2 deraadt 613: .Ev DISPLAY
1.40 aaron 614: set.
1.44 aaron 615: The argument must be
1.2 deraadt 616: .Dq yes
617: or
1.38 markus 618: .Dq no .
619: The default is
1.3 deraadt 620: .Dq no .
621: .It Cm GatewayPorts
622: Specifies whether remote hosts are allowed to connect to local
623: forwarded ports.
624: The argument must be
625: .Dq yes
626: or
627: .Dq no .
628: The default is
1.2 deraadt 629: .Dq no .
630: .It Cm GlobalKnownHostsFile
1.44 aaron 631: Specifies a file to use instead of
1.2 deraadt 632: .Pa /etc/ssh_known_hosts .
633: .It Cm HostName
1.40 aaron 634: Specifies the real host name to log into.
635: This can be used to specify nicknames or abbreviations for hosts.
636: Default is the name given on the command line.
637: Numeric IP addresses are also permitted (both on the command line and in
1.2 deraadt 638: .Cm HostName
1.1 deraadt 639: specifications).
1.2 deraadt 640: .It Cm IdentityFile
1.1 deraadt 641: Specifies the file from which the user's RSA authentication identity
1.2 deraadt 642: is read (default
643: .Pa .ssh/identity
644: in the user's home directory).
1.1 deraadt 645: Additionally, any identities represented by the authentication agent
1.40 aaron 646: will be used for authentication.
647: The file name may use the tilde
648: syntax to refer to a user's home directory.
649: It is possible to have
1.1 deraadt 650: multiple identity files specified in configuration files; all these
651: identities will be tried in sequence.
1.2 deraadt 652: .It Cm KeepAlive
1.1 deraadt 653: Specifies whether the system should send keepalive messages to the
1.40 aaron 654: other side.
655: If they are sent, death of the connection or crash of one
656: of the machines will be properly noticed.
657: However, this means that
1.1 deraadt 658: connections will die if the route is down temporarily, and some people
1.41 aaron 659: find it annoying.
1.2 deraadt 660: .Pp
661: The default is
662: .Dq yes
663: (to send keepalives), and the client will notice
1.40 aaron 664: if the network goes down or the remote host dies.
665: This is important in scripts, and many users want it too.
1.2 deraadt 666: .Pp
667: To disable keepalives, the value should be set to
668: .Dq no
669: in both the server and the client configuration files.
670: .It Cm KerberosAuthentication
1.42 aaron 671: Specifies whether Kerberos authentication will be used.
672: The argument to this keyword must be
1.4 dugsong 673: .Dq yes
674: or
675: .Dq no .
1.2 deraadt 676: .It Cm KerberosTgtPassing
1.42 aaron 677: Specifies whether a Kerberos TGT will be forwarded to the server.
678: This will only work if the Kerberos server is actually an AFS kaserver.
679: The argument to this keyword must be
1.4 dugsong 680: .Dq yes
681: or
682: .Dq no .
1.2 deraadt 683: .It Cm LocalForward
1.1 deraadt 684: Specifies that a TCP/IP port on the local machine be forwarded over
1.40 aaron 685: the secure channel to given host:port from the remote machine.
686: The first argument must be a port number, and the second must be
687: host:port.
688: Multiple forwardings may be specified, and additional
689: forwardings can be given on the command line.
690: Only the superuser can forward privileged ports.
1.24 markus 691: .It Cm LogLevel
692: Gives the verbosity level that is used when logging messages from
693: .Nm ssh .
694: The possible values are:
1.39 djm 695: QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG.
1.24 markus 696: The default is INFO.
1.14 dugsong 697: .It Cm NumberOfPasswordPrompts
1.42 aaron 698: Specifies the number of password prompts before giving up.
699: The argument to this keyword must be an integer.
700: Default is 3.
1.34 markus 701: .It Cm PasswordAuthentication
1.40 aaron 702: Specifies whether to use password authentication.
703: The argument to this keyword must be
1.34 markus 704: .Dq yes
705: or
706: .Dq no .
1.2 deraadt 707: .It Cm Port
1.40 aaron 708: Specifies the port number to connect on the remote host.
709: Default is 22.
1.45 markus 710: .It Cm Protocol
711: Specifies the protocol versions
712: .Nm
713: should support in order of preference.
714: The possible values are
715: .Dq 1
716: and
717: .Dq 2 .
718: Multiple versions must be comma-separated.
719: The default is
720: .Dq 1 .
1.2 deraadt 721: .It Cm ProxyCommand
1.40 aaron 722: Specifies the command to use to connect to the server.
723: The command
724: string extends to the end of the line, and is executed with
725: .Pa /bin/sh .
726: In the command string,
727: .Ql %h
728: will be substituted by the host name to
729: connect and
730: .Ql %p
731: by the port.
732: The command can be basically anything,
733: and should read from its standard input and write to its standard output.
734: It should eventually connect an
1.2 deraadt 735: .Xr sshd 8
1.1 deraadt 736: server running on some machine, or execute
1.2 deraadt 737: .Ic sshd -i
1.40 aaron 738: somewhere.
739: Host key management will be done using the
1.1 deraadt 740: HostName of the host being connected (defaulting to the name typed by
741: the user).
1.29 markus 742: Note that
743: .Cm CheckHostIP
744: is not available for connects with a proxy command.
1.2 deraadt 745: .Pp
746: .It Cm RemoteForward
1.1 deraadt 747: Specifies that a TCP/IP port on the remote machine be forwarded over
1.40 aaron 748: the secure channel to given host:port from the local machine.
749: The first argument must be a port number, and the second must be
750: host:port.
751: Multiple forwardings may be specified, and additional
752: forwardings can be given on the command line.
753: Only the superuser can forward privileged ports.
1.2 deraadt 754: .It Cm RhostsAuthentication
1.40 aaron 755: Specifies whether to try rhosts based authentication.
756: Note that this
1.1 deraadt 757: declaration only affects the client side and has no effect whatsoever
1.40 aaron 758: on security.
759: Disabling rhosts authentication may reduce
1.1 deraadt 760: authentication time on slow connections when rhosts authentication is
1.40 aaron 761: not used.
762: Most servers do not permit RhostsAuthentication because it
763: is not secure (see RhostsRSAAuthentication).
764: The argument to this keyword must be
1.2 deraadt 765: .Dq yes
766: or
767: .Dq no .
768: .It Cm RhostsRSAAuthentication
1.1 deraadt 769: Specifies whether to try rhosts based authentication with RSA host
1.40 aaron 770: authentication.
771: This is the primary authentication method for most sites.
772: The argument must be
1.2 deraadt 773: .Dq yes
774: or
775: .Dq no .
776: .It Cm RSAAuthentication
1.40 aaron 777: Specifies whether to try RSA authentication.
778: The argument to this keyword must be
1.2 deraadt 779: .Dq yes
780: or
781: .Dq no .
1.1 deraadt 782: RSA authentication will only be
783: attempted if the identity file exists, or an authentication agent is
784: running.
1.27 markus 785: .It Cm SkeyAuthentication
786: Specifies whether to use
787: .Xr skey 1
1.40 aaron 788: authentication.
789: The argument to this keyword must be
1.27 markus 790: .Dq yes
791: or
792: .Dq no .
793: The default is
794: .Dq no .
1.2 deraadt 795: .It Cm StrictHostKeyChecking
796: If this flag is set to
1.44 aaron 797: .Dq yes ,
1.2 deraadt 798: .Nm
1.1 deraadt 799: ssh will never automatically add host keys to the
1.2 deraadt 800: .Pa $HOME/.ssh/known_hosts
1.40 aaron 801: file, and refuses to connect hosts whose host key has changed.
802: This provides maximum protection against trojan horse attacks.
803: However, it can be somewhat annoying if you don't have good
1.2 deraadt 804: .Pa /etc/ssh_known_hosts
1.1 deraadt 805: files installed and frequently
1.40 aaron 806: connect new hosts.
807: Basically this option forces the user to manually
808: add any new hosts.
809: Normally this option is disabled, and new hosts
810: will automatically be added to the known host files.
811: The host keys of
812: known hosts will be verified automatically in either case.
813: The argument must be
1.2 deraadt 814: .Dq yes
815: or
816: .Dq no .
1.16 markus 817: .It Cm UsePrivilegedPort
818: Specifies whether to use a privileged port for outgoing connections.
819: The argument must be
820: .Dq yes
821: or
822: .Dq no .
823: The default is
824: .Dq yes .
825: Note that setting this option to
826: .Dq no
1.30 provos 827: turns off
1.16 markus 828: .Cm RhostsAuthentication
829: and
830: .Cm RhostsRSAAuthentication .
1.34 markus 831: .It Cm User
1.40 aaron 832: Specifies the user to log in as.
833: This can be useful if you have a different user name on different machines.
834: This saves the trouble of
1.34 markus 835: having to remember to give the user name on the command line.
836: .It Cm UserKnownHostsFile
837: Specifies a file to use instead of
838: .Pa $HOME/.ssh/known_hosts .
1.2 deraadt 839: .It Cm UseRsh
1.40 aaron 840: Specifies that rlogin/rsh should be used for this host.
841: It is possible that the host does not at all support the
1.2 deraadt 842: .Nm
1.40 aaron 843: protocol.
844: This causes
1.2 deraadt 845: .Nm
1.40 aaron 846: to immediately execute
1.2 deraadt 847: .Xr rsh 1 .
1.1 deraadt 848: All other options (except
1.2 deraadt 849: .Cm HostName )
1.40 aaron 850: are ignored if this has been specified.
851: The argument must be
1.2 deraadt 852: .Dq yes
853: or
854: .Dq no .
855: .Sh ENVIRONMENT
856: .Nm
1.1 deraadt 857: will normally set the following environment variables:
1.2 deraadt 858: .Bl -tag -width Ds
859: .It Ev DISPLAY
860: The
861: .Ev DISPLAY
1.40 aaron 862: variable indicates the location of the X11 server.
1.44 aaron 863: It is automatically set by
1.2 deraadt 864: .Nm
865: to point to a value of the form
866: .Dq hostname:n
867: where hostname indicates
1.40 aaron 868: the host where the shell runs, and n is an integer >= 1.
869: .Nm
870: uses this special value to forward X11 connections over the secure
871: channel.
872: The user should normally not set DISPLAY explicitly, as that
1.1 deraadt 873: will render the X11 connection insecure (and will require the user to
874: manually copy any required authorization cookies).
1.2 deraadt 875: .It Ev HOME
1.1 deraadt 876: Set to the path of the user's home directory.
1.2 deraadt 877: .It Ev LOGNAME
878: Synonym for
1.12 aaron 879: .Ev USER ;
880: set for compatibility with systems that use this variable.
1.2 deraadt 881: .It Ev MAIL
1.1 deraadt 882: Set to point the user's mailbox.
1.40 aaron 883: .It Ev PATH
1.2 deraadt 884: Set to the default
885: .Ev PATH ,
886: as specified when compiling
1.12 aaron 887: .Nm ssh .
1.18 markus 888: .It Ev SSH_AUTH_SOCK
1.17 markus 889: indicates the path of a unix-domain socket used to communicate with the
890: agent.
1.2 deraadt 891: .It Ev SSH_CLIENT
1.40 aaron 892: Identifies the client end of the connection.
893: The variable contains
1.1 deraadt 894: three space-separated values: client ip-address, client port number,
895: and server port number.
1.2 deraadt 896: .It Ev SSH_TTY
1.1 deraadt 897: This is set to the name of the tty (path to the device) associated
1.40 aaron 898: with the current shell or command.
899: If the current session has no tty,
1.1 deraadt 900: this variable is not set.
1.2 deraadt 901: .It Ev TZ
1.1 deraadt 902: The timezone variable is set to indicate the present timezone if it
903: was set when the daemon was started (e.i., the daemon passes the value
904: on to new connections).
1.2 deraadt 905: .It Ev USER
1.1 deraadt 906: Set to the name of the user logging in.
1.2 deraadt 907: .El
908: .Pp
1.44 aaron 909: Additionally,
1.2 deraadt 910: .Nm
1.44 aaron 911: reads
912: .Pa $HOME/.ssh/environment ,
1.2 deraadt 913: and adds lines of the format
914: .Dq VARNAME=value
1.12 aaron 915: to the environment.
1.2 deraadt 916: .Sh FILES
1.36 markus 917: .Bl -tag -width Ds
1.2 deraadt 918: .It Pa $HOME/.ssh/known_hosts
1.1 deraadt 919: Records host keys for all hosts the user has logged into (that are not
1.2 deraadt 920: in
921: .Pa /etc/ssh_known_hosts ) .
922: See
923: .Xr sshd 8 .
924: .It Pa $HOME/.ssh/identity
1.40 aaron 925: Contains the RSA authentication identity of the user.
926: This file
1.1 deraadt 927: contains sensitive data and should be readable by the user but not
1.15 markus 928: accessible by others (read/write/execute).
929: Note that
930: .Nm
931: ignores this file if it is accessible by others.
932: It is possible to specify a passphrase when
1.1 deraadt 933: generating the key; the passphrase will be used to encrypt the
1.8 deraadt 934: sensitive part of this file using 3DES.
1.44 aaron 935: .It Pa $HOME/.ssh/identity.pub
1.1 deraadt 936: Contains the public key for authentication (public part of the
1.40 aaron 937: identity file in human-readable form).
938: The contents of this file should be added to
1.2 deraadt 939: .Pa $HOME/.ssh/authorized_keys
940: on all machines
1.40 aaron 941: where you wish to log in using RSA authentication.
942: This file is not
943: sensitive and can (but need not) be readable by anyone.
944: This file is
1.1 deraadt 945: never used automatically and is not necessary; it is only provided for
946: the convenience of the user.
1.2 deraadt 947: .It Pa $HOME/.ssh/config
1.40 aaron 948: This is the per-user configuration file.
949: The format of this file is described above.
950: This file is used by the
1.2 deraadt 951: .Nm
1.40 aaron 952: client.
953: This file does not usually contain any sensitive information,
1.1 deraadt 954: but the recommended permissions are read/write for the user, and not
955: accessible by others.
1.2 deraadt 956: .It Pa $HOME/.ssh/authorized_keys
1.40 aaron 957: Lists the RSA keys that can be used for logging in as this user.
958: The format of this file is described in the
1.2 deraadt 959: .Xr sshd 8
1.40 aaron 960: manual page.
961: In the simplest form the format is the same as the .pub
1.1 deraadt 962: identity files (that is, each line contains the number of bits in
963: modulus, public exponent, modulus, and comment fields, separated by
1.40 aaron 964: spaces).
965: This file is not highly sensitive, but the recommended
1.1 deraadt 966: permissions are read/write for the user, and not accessible by others.
1.2 deraadt 967: .It Pa /etc/ssh_known_hosts
1.40 aaron 968: Systemwide list of known host keys.
969: This file should be prepared by the
1.1 deraadt 970: system administrator to contain the public host keys of all machines in the
1.40 aaron 971: organization.
972: This file should be world-readable.
973: This file contains
1.1 deraadt 974: public keys, one per line, in the following format (fields separated
975: by spaces): system name, number of bits in modulus, public exponent,
1.40 aaron 976: modulus, and optional comment field.
977: When different names are used
1.1 deraadt 978: for the same machine, all such names should be listed, separated by
1.40 aaron 979: commas.
980: The format is described on the
1.2 deraadt 981: .Xr sshd 8
1.1 deraadt 982: manual page.
1.2 deraadt 983: .Pp
1.1 deraadt 984: The canonical system name (as returned by name servers) is used by
1.2 deraadt 985: .Xr sshd 8
1.1 deraadt 986: to verify the client host when logging in; other names are needed because
1.2 deraadt 987: .Nm
1.1 deraadt 988: does not convert the user-supplied name to a canonical name before
989: checking the key, because someone with access to the name servers
990: would then be able to fool host authentication.
1.2 deraadt 991: .It Pa /etc/ssh_config
1.40 aaron 992: Systemwide configuration file.
993: This file provides defaults for those
1.1 deraadt 994: values that are not specified in the user's configuration file, and
1.40 aaron 995: for those users who do not have a configuration file.
996: This file must be world-readable.
1.2 deraadt 997: .It Pa $HOME/.rhosts
998: This file is used in
999: .Pa \&.rhosts
1000: authentication to list the
1.40 aaron 1001: host/user pairs that are permitted to log in.
1002: (Note that this file is
1.1 deraadt 1003: also used by rlogin and rsh, which makes using this file insecure.)
1004: Each line of the file contains a host name (in the canonical form
1005: returned by name servers), and then a user name on that host,
1.40 aaron 1006: separated by a space.
1007: One some machines this file may need to be
1.1 deraadt 1008: world-readable if the user's home directory is on a NFS partition,
1009: because
1.2 deraadt 1010: .Xr sshd 8
1.40 aaron 1011: reads it as root.
1012: Additionally, this file must be owned by the user,
1013: and must not have write permissions for anyone else.
1014: The recommended
1.1 deraadt 1015: permission for most machines is read/write for the user, and not
1016: accessible by others.
1.2 deraadt 1017: .Pp
1.1 deraadt 1018: Note that by default
1.2 deraadt 1019: .Xr sshd 8
1.1 deraadt 1020: will be installed so that it requires successful RSA host
1.40 aaron 1021: authentication before permitting \s+2.\s0rhosts authentication.
1022: If your server machine does not have the client's host key in
1.2 deraadt 1023: .Pa /etc/ssh_known_hosts ,
1024: you can store it in
1025: .Pa $HOME/.ssh/known_hosts .
1026: The easiest way to do this is to
1.1 deraadt 1027: connect back to the client from the server machine using ssh; this
1.2 deraadt 1028: will automatically add the host key inxi
1029: .Pa $HOME/.ssh/known_hosts .
1030: .It Pa $HOME/.shosts
1031: This file is used exactly the same way as
1032: .Pa \&.rhosts .
1033: The purpose for
1.1 deraadt 1034: having this file is to be able to use rhosts authentication with
1.2 deraadt 1035: .Nm
1036: without permitting login with
1037: .Xr rlogin 1
1038: or
1039: .Xr rsh 1 .
1040: .It Pa /etc/hosts.equiv
1041: This file is used during
1.40 aaron 1042: .Pa \&.rhosts authentication.
1043: It contains
1.1 deraadt 1044: canonical hosts names, one per line (the full format is described on
1045: the
1.2 deraadt 1046: .Xr sshd 8
1.40 aaron 1047: manual page).
1048: If the client host is found in this file, login is
1.1 deraadt 1049: automatically permitted provided client and server user names are the
1.40 aaron 1050: same.
1051: Additionally, successful RSA host authentication is normally
1052: required.
1053: This file should only be writable by root.
1.2 deraadt 1054: .It Pa /etc/shosts.equiv
1.44 aaron 1055: This file is processed exactly as
1.2 deraadt 1056: .Pa /etc/hosts.equiv .
1.1 deraadt 1057: This file may be useful to permit logins using
1.2 deraadt 1058: .Nm
1.1 deraadt 1059: but not using rsh/rlogin.
1.2 deraadt 1060: .It Pa /etc/sshrc
1.1 deraadt 1061: Commands in this file are executed by
1.2 deraadt 1062: .Nm
1.1 deraadt 1063: when the user logs in just before the user's shell (or command) is started.
1064: See the
1.2 deraadt 1065: .Xr sshd 8
1.1 deraadt 1066: manual page for more information.
1.2 deraadt 1067: .It Pa $HOME/.ssh/rc
1.1 deraadt 1068: Commands in this file are executed by
1.2 deraadt 1069: .Nm
1.1 deraadt 1070: when the user logs in just before the user's shell (or command) is
1071: started.
1.44 aaron 1072: See the
1.2 deraadt 1073: .Xr sshd 8
1.1 deraadt 1074: manual page for more information.
1.31 markus 1075: .It Pa $HOME/.ssh/environment
1076: Contains additional definitions for environment variables, see section
1077: .Sx ENVIRONMENT
1078: above.
1.5 deraadt 1079: .It Pa libcrypto.so.X.1
1080: A version of this library which includes support for the RSA algorithm
1081: is required for proper operation.
1.2 deraadt 1082: .Sh AUTHOR
1.20 provos 1083: OpenSSH
1.37 deraadt 1084: is a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen,
1.40 aaron 1085: but with bugs removed and newer features re-added.
1086: Rapidly after the
1.37 deraadt 1087: 1.2.12 release, newer versions of the original ssh bore successively
1088: more restrictive licenses, and thus demand for a free version was born.
1.47 ! markus 1089: .Pp
1.37 deraadt 1090: This version of OpenSSH
1.20 provos 1091: .Bl -bullet
1092: .It
1.35 aaron 1093: has all components of a restrictive nature (i.e., patents, see
1.21 deraadt 1094: .Xr ssl 8 )
1095: directly removed from the source code; any licensed or patented components
1096: are chosen from
1097: external libraries.
1.20 provos 1098: .It
1.47 ! markus 1099: has been updated to support SSH protocol 1.5 and 2, making it compatible with
! 1100: all other SSH clients and servers.
1.20 provos 1101: .It
1.44 aaron 1102: contains added support for
1.20 provos 1103: .Xr kerberos 8
1104: authentication and ticket passing.
1105: .It
1.21 deraadt 1106: supports one-time password authentication with
1.20 provos 1107: .Xr skey 1 .
1108: .El
1109: .Pp
1110: The libraries described in
1.5 deraadt 1111: .Xr ssl 8
1112: are required for proper operation.
1.25 provos 1113: .Pp
1.26 aaron 1114: OpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl,
1.25 provos 1115: Niels Provos, Theo de Raadt, and Dug Song.
1.47 ! markus 1116: .Pp
! 1117: The support for SSH protocol 2 was written by Markus Friedl.
1.2 deraadt 1118: .Sh SEE ALSO
1119: .Xr rlogin 1 ,
1120: .Xr rsh 1 ,
1121: .Xr scp 1 ,
1122: .Xr ssh-add 1 ,
1123: .Xr ssh-agent 1 ,
1124: .Xr ssh-keygen 1 ,
1125: .Xr telnet 1 ,
1.5 deraadt 1126: .Xr sshd 8 ,
1127: .Xr ssl 8