[BACK]Return to ssh.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/ssh.1, Revision 1.59

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