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

Diff for /src/usr.bin/ssh/sshd.8 between version 1.208.2.1 and 1.208.2.2

version 1.208.2.1, 2006/02/03 03:01:58 version 1.208.2.2, 2006/10/06 03:19:33
Line 81 
Line 81 
 .Nm  .Nm
 rereads its configuration file when it receives a hangup signal,  rereads its configuration file when it receives a hangup signal,
 .Dv SIGHUP ,  .Dv SIGHUP ,
 by executing itself with the name and options it was started with, e.g.,  by executing itself with the name and options it was started with, e.g.\&
 .Pa /usr/sbin/sshd .  .Pa /usr/sbin/sshd .
 .Pp  .Pp
 The options are as follows:  The options are as follows:
Line 154 
Line 154 
 from inetd because it needs to generate the server key before it can  from inetd because it needs to generate the server key before it can
 respond to the client, and this may take tens of seconds.  respond to the client, and this may take tens of seconds.
 Clients would have to wait too long if the key was regenerated every time.  Clients would have to wait too long if the key was regenerated every time.
 However, with small key sizes (e.g., 512) using  However, with small key sizes (e.g. 512) using
 .Nm  .Nm
 from inetd may  from inetd may
 be feasible.  be feasible.
Line 282 
Line 282 
 challenge-response authentication,  challenge-response authentication,
 or password authentication.  or password authentication.
 .Pp  .Pp
 System security is not improved unless  
 .Nm rshd ,  
 .Nm rlogind ,  
 and  
 .Nm rexecd  
 are disabled (thus completely disabling  
 .Xr rlogin  
 and  
 .Xr rsh  
 into the machine).  
 .Sh COMMAND EXECUTION AND DATA FORWARDING  
 If the client successfully authenticates itself, a dialog for  If the client successfully authenticates itself, a dialog for
 preparing the session is entered.  preparing the session is entered.
 At this time the client may request  At this time the client may request
Line 300 
Line 289 
 forwarding TCP connections, or forwarding the authentication agent  forwarding TCP connections, or forwarding the authentication agent
 connection over the secure channel.  connection over the secure channel.
 .Pp  .Pp
 Finally, the client either requests a shell or execution of a command.  After this, the client either requests a shell or execution of a command.
 The sides then enter session mode.  The sides then enter session mode.
 In this mode, either side may send  In this mode, either side may send
 data at any time, and such data is forwarded to/from the shell or  data at any time, and such data is forwarded to/from the shell or
Line 355 
Line 344 
 .Dq rc  .Dq rc
 files are given the X11  files are given the X11
 authentication protocol and cookie in standard input.  authentication protocol and cookie in standard input.
   See
   .Sx SSHRC ,
   below.
 .It  .It
 Runs user's shell or command.  Runs user's shell or command.
 .El  .El
   .Sh SSHRC
   If the file
   .Pa ~/.ssh/rc
   exists,
   .Xr sh 1
   runs it after reading the
   environment files but before starting the user's shell or command.
   It must not produce any output on stdout; stderr must be used
   instead.
   If X11 forwarding is in use, it will receive the "proto cookie" pair in
   its standard input (and
   .Ev DISPLAY
   in its environment).
   The script must call
   .Xr xauth 1
   because
   .Nm
   will not run xauth automatically to add X11 cookies.
   .Pp
   The primary purpose of this file is to run any initialization routines
   which may be needed before the user's home directory becomes
   accessible; AFS is a particular example of such an environment.
   .Pp
   This file will probably contain some initialization code followed by
   something similar to:
   .Bd -literal -offset 3n
   if read proto cookie && [ -n "$DISPLAY" ]; then
           if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then
                   # X11UseLocalhost=yes
                   echo add unix:`echo $DISPLAY |
                       cut -c11-` $proto $cookie
           else
                   # X11UseLocalhost=no
                   echo add $DISPLAY $proto $cookie
           fi | xauth -q -
   fi
   .Ed
   .Pp
   If this file does not exist,
   .Pa /etc/ssh/sshrc
   is run, and if that
   does not exist either, xauth is used to add the cookie.
 .Sh AUTHORIZED_KEYS FILE FORMAT  .Sh AUTHORIZED_KEYS FILE FORMAT
 .Pa ~/.ssh/authorized_keys  
 is the default file that lists the public keys that are  
 permitted for RSA authentication in protocol version 1  
 and for public key authentication (PubkeyAuthentication)  
 in protocol version 2.  
 .Cm AuthorizedKeysFile  .Cm AuthorizedKeysFile
 may be used to specify an alternative file.  specifies the file containing public keys for
 .Pp  public key authentication;
   if none is specified, the default is
   .Pa ~/.ssh/authorized_keys .
 Each line of the file contains one  Each line of the file contains one
 key (empty lines and lines starting with a  key (empty lines and lines starting with a
 .Ql #  .Ql #
 are ignored as  are ignored as
 comments).  comments).
 Each RSA public key consists of the following fields, separated by  Protocol 1 public keys consist of the following space-separated fields:
 spaces: options, bits, exponent, modulus, comment.  options, bits, exponent, modulus, comment.
 Each protocol version 2 public key consists of:  Protocol 2 public key consist of:
 options, keytype, base64 encoded key, comment.  options, keytype, base64-encoded key, comment.
 The options field  The options field is optional;
 is optional; its presence is determined by whether the line starts  its presence is determined by whether the line starts
 with a number or not (the options field never starts with a number).  with a number or not (the options field never starts with a number).
 The bits, exponent, modulus and comment fields give the RSA key for  The bits, exponent, modulus, and comment fields give the RSA key for
 protocol version 1; the  protocol version 1; the
 comment field is not used for anything (but may be convenient for the  comment field is not used for anything (but may be convenient for the
 user to identify the key).  user to identify the key).
Line 394 
Line 425 
 keys up to 16 kilobits.  keys up to 16 kilobits.
 You don't want to type them in; instead, copy the  You don't want to type them in; instead, copy the
 .Pa identity.pub ,  .Pa identity.pub ,
 .Pa id_dsa.pub  .Pa id_dsa.pub ,
 or the  or the
 .Pa id_rsa.pub  .Pa id_rsa.pub
 file and edit it.  file and edit it.
Line 409 
Line 440 
 The following option specifications are supported (note  The following option specifications are supported (note
 that option keywords are case-insensitive):  that option keywords are case-insensitive):
 .Bl -tag -width Ds  .Bl -tag -width Ds
 .It Cm from="pattern-list"  
 Specifies that in addition to public key authentication, the canonical name  
 of the remote host must be present in the comma-separated list of  
 patterns  
 .Pf ( Ql \&*  
 and  
 .Ql \&?  
 serve as wildcards).  
 The list may also contain  
 patterns negated by prefixing them with  
 .Ql \&! ;  
 if the canonical host name matches a negated pattern, the key is not accepted.  
 The purpose  
 of this option is to optionally increase security: public key authentication  
 by itself does not trust the network or name servers or anything (but  
 the key); however, if somebody somehow steals the key, the key  
 permits an intruder to log in from anywhere in the world.  
 This additional option makes using a stolen key more difficult (name  
 servers and/or routers would have to be compromised in addition to  
 just the key).  
 .It Cm command="command"  .It Cm command="command"
 Specifies that the command is executed whenever this key is used for  Specifies that the command is executed whenever this key is used for
 authentication.  authentication.
Line 444 
Line 455 
 An example might be a key that permits remote backups but nothing else.  An example might be a key that permits remote backups but nothing else.
 Note that the client may specify TCP and/or X11  Note that the client may specify TCP and/or X11
 forwarding unless they are explicitly prohibited.  forwarding unless they are explicitly prohibited.
   The command originally supplied by the client is available in the
   .Ev SSH_ORIGINAL_COMMAND
   environment variable.
 Note that this option applies to shell, command or subsystem execution.  Note that this option applies to shell, command or subsystem execution.
 .It Cm environment="NAME=value"  .It Cm environment="NAME=value"
 Specifies that the string is to be added to the environment when  Specifies that the string is to be added to the environment when
Line 458 
Line 472 
 This option is automatically disabled if  This option is automatically disabled if
 .Cm UseLogin  .Cm UseLogin
 is enabled.  is enabled.
   .It Cm from="pattern-list"
   Specifies that in addition to public key authentication, the canonical name
   of the remote host must be present in the comma-separated list of
   patterns.
   The purpose
   of this option is to optionally increase security: public key authentication
   by itself does not trust the network or name servers or anything (but
   the key); however, if somebody somehow steals the key, the key
   permits an intruder to log in from anywhere in the world.
   This additional option makes using a stolen key more difficult (name
   servers and/or routers would have to be compromised in addition to
   just the key).
   .Pp
   See
   .Sx PATTERNS
   in
   .Xr ssh_config 5
   for more information on patterns.
   .It Cm no-agent-forwarding
   Forbids authentication agent forwarding when this key is used for
   authentication.
 .It Cm no-port-forwarding  .It Cm no-port-forwarding
 Forbids TCP forwarding when this key is used for authentication.  Forbids TCP forwarding when this key is used for authentication.
 Any port forward requests by the client will return an error.  Any port forward requests by the client will return an error.
 This might be used, e.g., in connection with the  This might be used, e.g. in connection with the
 .Cm command  .Cm command
 option.  option.
   .It Cm no-pty
   Prevents tty allocation (a request to allocate a pty will fail).
 .It Cm no-X11-forwarding  .It Cm no-X11-forwarding
 Forbids X11 forwarding when this key is used for authentication.  Forbids X11 forwarding when this key is used for authentication.
 Any X11 forward requests by the client will return an error.  Any X11 forward requests by the client will return an error.
 .It Cm no-agent-forwarding  
 Forbids authentication agent forwarding when this key is used for  
 authentication.  
 .It Cm no-pty  
 Prevents tty allocation (a request to allocate a pty will fail).  
 .It Cm permitopen="host:port"  .It Cm permitopen="host:port"
 Limit local  Limit local
 .Li ``ssh -L''  .Li ``ssh -L''
Line 491 
Line 523 
 Without this option, the next available device will be used if  Without this option, the next available device will be used if
 the client requests a tunnel.  the client requests a tunnel.
 .El  .El
 .Ss Examples  
 1024 33 12121...312314325 ylo@foo.bar  
 .Pp  .Pp
 from="*.niksula.hut.fi,!pc.niksula.hut.fi" 1024 35 23...2334 ylo@niksula  An example authorized_keys file:
 .Pp  .Bd -literal -offset 3n
 command="dump /home",no-pty,no-port-forwarding 1024 33 23...2323 backup.hut.fi  # Comments allowed at start of line
 .Pp  ssh-rsa AAAAB3Nza...LiPk== user@example.net
 permitopen="10.2.1.55:80",permitopen="10.2.1.56:25" 1024 33 23...2323  from="*.sales.example.net,!pc.sales.example.net" ssh-rsa
 .Pp  AAAAB2...19Q== john@example.net
 tunnel="0",command="sh /etc/netstart tun0" ssh-rsa AAAA...== reyk@openbsd.org  command="dump /home",no-pty,no-port-forwarding ssh-dss
   AAAAC3...51R== example.net
   permitopen="192.0.2.1:80",permitopen="192.0.2.2:25" ssh-dss
   AAAAB5...21S==
   tunnel="0",command="sh /etc/netstart tun0" ssh-rsa AAAA...==
   jane@example.net
   .Ed
 .Sh SSH_KNOWN_HOSTS FILE FORMAT  .Sh SSH_KNOWN_HOSTS FILE FORMAT
 The  The
 .Pa /etc/ssh/ssh_known_hosts  .Pa /etc/ssh/ssh_known_hosts
Line 509 
Line 545 
 files contain host public keys for all known hosts.  files contain host public keys for all known hosts.
 The global file should  The global file should
 be prepared by the administrator (optional), and the per-user file is  be prepared by the administrator (optional), and the per-user file is
 maintained automatically: whenever the user connects from an unknown host  maintained automatically: whenever the user connects from an unknown host,
 its key is added to the per-user file.  its key is added to the per-user file.
 .Pp  .Pp
 Each line in these files contains the following fields: hostnames,  Each line in these files contains the following fields: hostnames,
Line 517 
Line 553 
 The fields are separated by spaces.  The fields are separated by spaces.
 .Pp  .Pp
 Hostnames is a comma-separated list of patterns  Hostnames is a comma-separated list of patterns
 .Pf ( Ql \&*  .Pf ( Ql *
 and  and
 .Ql \&?  .Ql \&?
 act as  act as
Line 529 
Line 565 
 to indicate negation: if the host name matches a negated  to indicate negation: if the host name matches a negated
 pattern, it is not accepted (by that line) even if it matched another  pattern, it is not accepted (by that line) even if it matched another
 pattern on the line.  pattern on the line.
   A hostname or address may optionally be enclosed within
   .Ql \&[
   and
   .Ql \&]
   brackets then followed by
   .Ql \&:
   and a non-standard port number.
 .Pp  .Pp
 Alternately, hostnames may be stored in a hashed form which hides host names  Alternately, hostnames may be stored in a hashed form which hides host names
 and addresses should the file's contents be disclosed.  and addresses should the file's contents be disclosed.
Line 539 
Line 582 
 negation or wildcard operators may be applied.  negation or wildcard operators may be applied.
 .Pp  .Pp
 Bits, exponent, and modulus are taken directly from the RSA host key; they  Bits, exponent, and modulus are taken directly from the RSA host key; they
 can be obtained, e.g., from  can be obtained, for example, from
 .Pa /etc/ssh/ssh_host_key.pub .  .Pa /etc/ssh/ssh_host_key.pub .
 The optional comment field continues to the end of the line, and is not used.  The optional comment field continues to the end of the line, and is not used.
 .Pp  .Pp
Line 564 
Line 607 
 or by taking  or by taking
 .Pa /etc/ssh/ssh_host_key.pub  .Pa /etc/ssh/ssh_host_key.pub
 and adding the host names at the front.  and adding the host names at the front.
 .Ss Examples  .Pp
 .Bd -literal  An example ssh_known_hosts file:
 closenet,...,130.233.208.41 1024 37 159...93 closenet.hut.fi  .Bd -literal -offset 3n
 cvs.openbsd.org,199.185.137.3 ssh-rsa AAAA1234.....=  # Comments allowed at start of line
 .Ed  closenet,...,192.0.2.53 1024 37 159...93 closenet.example.net
 .Bd -literal  cvs.example.net,192.0.2.10 ssh-rsa AAAA1234.....=
 # A hashed hostname  # A hashed hostname
 |1|JfKTdBh7rNbXkVAQCRp4OQoPfmI=|USECr3SWf1JUPsms5AqfD5QfxkM= ssh-rsa  |1|JfKTdBh7rNbXkVAQCRp4OQoPfmI=|USECr3SWf1JUPsms5AqfD5QfxkM= ssh-rsa
 AAAA1234.....=  AAAA1234.....=
 .Ed  .Ed
 .Sh FILES  .Sh FILES
 .Bl -tag -width Ds  .Bl -tag -width Ds -compact
 .It Pa /etc/ssh/sshd_config  .It ~/.hushlogin
 Contains configuration data for  
 .Nm sshd .  
 The file format and configuration options are described in  
 .Xr sshd_config 5 .  
 .It Pa /etc/ssh/ssh_host_key, /etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_rsa_key  
 These three files contain the private parts of the host keys.  
 These files should only be owned by root, readable only by root, and not  
 accessible to others.  
 Note that  
 .Nm  
 does not start if this file is group/world-accessible.  
 .It Pa /etc/ssh/ssh_host_key.pub, /etc/ssh/ssh_host_dsa_key.pub, /etc/ssh/ssh_host_rsa_key.pub  
 These three files contain the public parts of the host keys.  
 These files should be world-readable but writable only by  
 root.  
 Their contents should match the respective private parts.  
 These files are not  
 really used for anything; they are provided for the convenience of  
 the user so their contents can be copied to known hosts files.  
 These files are created using  
 .Xr ssh-keygen 1 .  
 .It Pa /etc/moduli  
 Contains Diffie-Hellman groups used for the "Diffie-Hellman Group Exchange".  
 The file format is described in  
 .Xr moduli 5 .  
 .It Pa /var/empty  
 .Xr chroot 2  
 directory used by  
 .Nm  
 during privilege separation in the pre-authentication phase.  
 The directory should not contain any files and must be owned by root  
 and not group or world-writable.  
 .It Pa /var/run/sshd.pid  
 Contains the process ID of the  
 .Nm  
 listening for connections (if there are several daemons running  
 concurrently for different ports, this contains the process ID of the one  
 started last).  
 The content of this file is not sensitive; it can be world-readable.  
 .It Pa ~/.ssh/authorized_keys  
 Lists the public keys (RSA or DSA) that can be used to log into the user's account.  
 This file must be readable by root (which may on some machines imply  
 it being world-readable if the user's home directory resides on an NFS  
 volume).  
 It is recommended that it not be accessible by others.  
 The format of this file is described above.  
 Users will place the contents of their  
 .Pa identity.pub ,  
 .Pa id_dsa.pub  
 and/or  
 .Pa id_rsa.pub  
 files into this file, as described in  
 .Xr ssh-keygen 1 .  
 .It Pa "/etc/ssh/ssh_known_hosts", "~/.ssh/known_hosts"  
 These files are consulted when using rhosts with RSA host  
 authentication or protocol version 2 hostbased authentication  
 to check the public key of the host.  
 The key must be listed in one of these files to be accepted.  
 The client uses the same files  
 to verify that it is connecting to the correct remote host.  
 These files should be writable only by root/the owner.  
 .Pa /etc/ssh/ssh_known_hosts  
 should be world-readable, and  
 .Pa ~/.ssh/known_hosts  
 can, but need not be, world-readable.  
 .It Pa /etc/motd  
 See  
 .Xr motd 5 .  
 .It Pa ~/.hushlogin  
 This file is used to suppress printing the last login time and  This file is used to suppress printing the last login time and
 .Pa /etc/motd ,  .Pa /etc/motd ,
 if  if
Line 656 
Line 630 
 are enabled.  are enabled.
 It does not suppress printing of the banner specified by  It does not suppress printing of the banner specified by
 .Cm Banner .  .Cm Banner .
 .It Pa /etc/nologin  .Pp
 If this file exists,  .It ~/.rhosts
   This file is used for host-based authentication (see
   .Xr ssh 1
   for more information).
   On some machines this file may need to be
   world-readable if the user's home directory is on an NFS partition,
   because
 .Nm  .Nm
 refuses to let anyone except root log in.  reads it as root.
 The contents of the file  Additionally, this file must be owned by the user,
 are displayed to anyone trying to log in, and non-root connections are  and must not have write permissions for anyone else.
 refused.  The recommended
 The file should be world-readable.  permission for most machines is read/write for the user, and not
 .It Pa /etc/hosts.allow, /etc/hosts.deny  
 Access controls that should be enforced by tcp-wrappers are defined here.  
 Further details are described in  
 .Xr hosts_access 5 .  
 .It Pa ~/.rhosts  
 This file is used during  
 .Cm RhostsRSAAuthentication  
 and  
 .Cm HostbasedAuthentication  
 and contains host-username pairs, separated by a space, one per  
 line.  
 The given user on the corresponding host is permitted to log in  
 without a password.  
 The same file is used by rlogind and rshd.  
 The file must  
 be writable only by the user; it is recommended that it not be  
 accessible by others.  accessible by others.
 .Pp  .Pp
 It is also possible to use netgroups in the file.  .It ~/.shosts
 Either host or user  This file is used in exactly the same way as
 name may be of the form +@groupname to specify all hosts or all users  .Pa .rhosts ,
 in the group.  but allows host-based authentication without permitting login with
 .It Pa ~/.shosts  rlogin/rsh.
 For ssh,  
 this file is exactly the same as for  
 .Pa .rhosts .  
 However, this file is  
 not used by rlogin and rshd, so using this permits access using SSH only.  
 .It Pa /etc/hosts.equiv  
 This file is used during  
 .Cm RhostsRSAAuthentication  
 and  
 .Cm HostbasedAuthentication  
 authentication.  
 In the simplest form, this file contains host names, one per line.  
 Users on  
 those hosts are permitted to log in without a password, provided they  
 have the same user name on both machines.  
 The host name may also be  
 followed by a user name; such users are permitted to log in as  
 .Em any  
 user on this machine (except root).  
 Additionally, the syntax  
 .Dq +@group  
 can be used to specify netgroups.  
 Negated entries start with  
 .Ql \&- .  
 .Pp  .Pp
 If the client host/user is successfully matched in this file, login is  .It ~/.ssh/authorized_keys
 automatically permitted provided the client and server user names are the  Lists the public keys (RSA/DSA) that can be used for logging in as this user.
 same.  The format of this file is described above.
 Additionally, successful client host key authentication is required.  The content of the file is not highly sensitive, but the recommended
 This file must be writable only by root; it is recommended  permissions are read/write for the user, and not accessible by others.
 that it be world-readable.  
 .Pp  .Pp
 .Sy "Warning: It is almost never a good idea to use user names in"  If this file, the
 .Pa hosts.equiv .  .Pa ~/.ssh
 Beware that it really means that the named user(s) can log in as  directory, or the user's home directory are writable
 .Em anybody ,  by other users, then the file could be modified or replaced by unauthorized
 which includes bin, daemon, adm, and other accounts that own critical  users.
 binaries and directories.  In this case,
 Using a user name practically grants the user root access.  .Nm
 The only valid use for user names that I can think  will not allow it to be used unless the
 of is in negative entries.  .Cm StrictModes
   option has been set to
   .Dq no .
   The recommended permissions can be set by executing
   .Dq chmod go-w ~/ ~/.ssh ~/.ssh/authorized_keys .
 .Pp  .Pp
 Note that this warning also applies to rsh/rlogin.  .It ~/.ssh/environment
 .It Pa /etc/shosts.equiv  
 This is processed exactly as  
 .Pa /etc/hosts.equiv .  
 However, this file may be useful in environments that want to run both  
 rsh/rlogin and ssh.  
 .It Pa ~/.ssh/environment  
 This file is read into the environment at login (if it exists).  This file is read into the environment at login (if it exists).
 It can only contain empty lines, comment lines (that start with  It can only contain empty lines, comment lines (that start with
 .Ql # ) ,  .Ql # ) ,
Line 746 
Line 683 
 controlled via the  controlled via the
 .Cm PermitUserEnvironment  .Cm PermitUserEnvironment
 option.  option.
 .It Pa ~/.ssh/rc  .Pp
 If this file exists, it is run with  .It ~/.ssh/known_hosts
 .Pa /bin/sh  Contains a list of host keys for all hosts the user has logged into
 after reading the  that are not already in the systemwide list of known host keys.
 environment files but before starting the user's shell or command.  The format of this file is described above.
 It must not produce any output on stdout; stderr must be used  This file should be writable only by root/the owner and
 instead.  can, but need not be, world-readable.
 If X11 forwarding is in use, it will receive the "proto cookie" pair in  .Pp
 its standard input (and  .It ~/.ssh/rc
 .Ev DISPLAY  Contains initialization routines to be run before
 in its environment).  the user's home directory becomes accessible.
 The script must call  This file should be writable only by the user, and need not be
 .Xr xauth 1  readable by anyone else.
 because  .Pp
   .It /etc/hosts.allow
   .It /etc/hosts.deny
   Access controls that should be enforced by tcp-wrappers are defined here.
   Further details are described in
   .Xr hosts_access 5 .
   .Pp
   .It /etc/hosts.equiv
   This file is for host-based authentication (see
   .Xr ssh 1 ) .
   It should only be writable by root.
   .Pp
   .It /etc/moduli
   Contains Diffie-Hellman groups used for the "Diffie-Hellman Group Exchange".
   The file format is described in
   .Xr moduli 5 .
   .Pp
   .It /etc/motd
   See
   .Xr motd 5 .
   .Pp
   .It /etc/nologin
   If this file exists,
 .Nm  .Nm
 will not run xauth automatically to add X11 cookies.  refuses to let anyone except root log in.
   The contents of the file
   are displayed to anyone trying to log in, and non-root connections are
   refused.
   The file should be world-readable.
 .Pp  .Pp
 The primary purpose of this file is to run any initialization routines  .It /etc/shosts.equiv
 which may be needed before the user's home directory becomes  This file is used in exactly the same way as
 accessible; AFS is a particular example of such an environment.  .Pa hosts.equiv ,
   but allows host-based authentication without permitting login with
   rlogin/rsh.
 .Pp  .Pp
 This file will probably contain some initialization code followed by  .It /etc/ssh/ssh_known_hosts
 something similar to:  Systemwide list of known host keys.
 .Bd -literal  This file should be prepared by the
 if read proto cookie && [ -n "$DISPLAY" ]; then  system administrator to contain the public host keys of all machines in the
         if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then  organization.
                 # X11UseLocalhost=yes  The format of this file is described above.
                 echo add unix:`echo $DISPLAY |  This file should be writable only by root/the owner and
                     cut -c11-` $proto $cookie  should be world-readable.
         else  
                 # X11UseLocalhost=no  
                 echo add $DISPLAY $proto $cookie  
         fi | xauth -q -  
 fi  
 .Ed  
 .Pp  .Pp
 If this file does not exist,  .It /etc/ssh/ssh_host_key
 .Pa /etc/ssh/sshrc  .It /etc/ssh/ssh_host_dsa_key
 is run, and if that  .It /etc/ssh/ssh_host_rsa_key
 does not exist either, xauth is used to add the cookie.  These three files contain the private parts of the host keys.
   These files should only be owned by root, readable only by root, and not
   accessible to others.
   Note that
   .Nm
   does not start if these files are group/world-accessible.
 .Pp  .Pp
 This file should be writable only by the user, and need not be  .It /etc/ssh/ssh_host_key.pub
 readable by anyone else.  .It /etc/ssh/ssh_host_dsa_key.pub
 .It Pa /etc/ssh/sshrc  .It /etc/ssh/ssh_host_rsa_key.pub
 Like  These three files contain the public parts of the host keys.
 .Pa ~/.ssh/rc .  These files should be world-readable but writable only by
 This can be used to specify  root.
   Their contents should match the respective private parts.
   These files are not
   really used for anything; they are provided for the convenience of
   the user so their contents can be copied to known hosts files.
   These files are created using
   .Xr ssh-keygen 1 .
   .Pp
   .It /etc/ssh/sshd_config
   Contains configuration data for
   .Nm sshd .
   The file format and configuration options are described in
   .Xr sshd_config 5 .
   .Pp
   .It /etc/ssh/sshrc
   Similar to
   .Pa ~/.ssh/rc ,
   it can be used to specify
 machine-specific login-time initializations globally.  machine-specific login-time initializations globally.
 This file should be writable only by root, and should be world-readable.  This file should be writable only by root, and should be world-readable.
   .Pp
   .It /var/empty
   .Xr chroot 2
   directory used by
   .Nm
   during privilege separation in the pre-authentication phase.
   The directory should not contain any files and must be owned by root
   and not group or world-writable.
   .Pp
   .It /var/run/sshd.pid
   Contains the process ID of the
   .Nm
   listening for connections (if there are several daemons running
   concurrently for different ports, this contains the process ID of the one
   started last).
   The content of this file is not sensitive; it can be world-readable.
 .El  .El
 .Sh SEE ALSO  .Sh SEE ALSO
 .Xr scp 1 ,  .Xr scp 1 ,
Line 810 
Line 807 
 .Xr sshd_config 5 ,  .Xr sshd_config 5 ,
 .Xr inetd 8 ,  .Xr inetd 8 ,
 .Xr sftp-server 8  .Xr sftp-server 8
 .Rs  
 .%A T. Ylonen  
 .%A T. Kivinen  
 .%A M. Saarinen  
 .%A T. Rinne  
 .%A S. Lehtinen  
 .%T "SSH Protocol Architecture"  
 .%N draft-ietf-secsh-architecture-12.txt  
 .%D January 2002  
 .%O work in progress material  
 .Re  
 .Rs  
 .%A M. Friedl  
 .%A N. Provos  
 .%A W. A. Simpson  
 .%T "Diffie-Hellman Group Exchange for the SSH Transport Layer Protocol"  
 .%N draft-ietf-secsh-dh-group-exchange-02.txt  
 .%D January 2002  
 .%O work in progress material  
 .Re  
 .Sh AUTHORS  .Sh AUTHORS
 OpenSSH is a derivative of the original and free  OpenSSH is a derivative of the original and free
 ssh 1.2.12 release by Tatu Ylonen.  ssh 1.2.12 release by Tatu Ylonen.
Line 841 
Line 818 
 protocol versions 1.5 and 2.0.  protocol versions 1.5 and 2.0.
 Niels Provos and Markus Friedl contributed support  Niels Provos and Markus Friedl contributed support
 for privilege separation.  for privilege separation.
   .Sh CAVEATS
   System security is not improved unless
   .Nm rshd ,
   .Nm rlogind ,
   and
   .Nm rexecd
   are disabled (thus completely disabling
   .Xr rlogin
   and
   .Xr rsh
   into the machine).

Legend:
Removed from v.1.208.2.1  
changed lines
  Added in v.1.208.2.2