1511b41d2SMark Murray.\" -*- nroff -*- 2511b41d2SMark Murray.\" 3511b41d2SMark Murray.\" sshd.8.in 4511b41d2SMark Murray.\" 5511b41d2SMark Murray.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 6511b41d2SMark Murray.\" 7511b41d2SMark Murray.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 8511b41d2SMark Murray.\" All rights reserved 9511b41d2SMark Murray.\" 10511b41d2SMark Murray.\" Created: Sat Apr 22 21:55:14 1995 ylo 11511b41d2SMark Murray.\" 12e8aafc91SKris Kennaway.\" $Id: sshd.8,v 1.51 2000/05/08 17:42:31 hugh Exp $ 1342f71286SMark Murray.\" $FreeBSD$ 14511b41d2SMark Murray.\" 15511b41d2SMark Murray.Dd September 25, 1999 16511b41d2SMark Murray.Dt SSHD 8 17511b41d2SMark Murray.Os 18511b41d2SMark Murray.Sh NAME 19511b41d2SMark Murray.Nm sshd 20511b41d2SMark Murray.Nd secure shell daemon 21511b41d2SMark Murray.Sh SYNOPSIS 22511b41d2SMark Murray.Nm sshd 23511b41d2SMark Murray.Op Fl diqQ46 24511b41d2SMark Murray.Op Fl b Ar bits 25511b41d2SMark Murray.Op Fl f Ar config_file 26511b41d2SMark Murray.Op Fl g Ar login_grace_time 27511b41d2SMark Murray.Op Fl h Ar host_key_file 28511b41d2SMark Murray.Op Fl k Ar key_gen_time 29511b41d2SMark Murray.Op Fl p Ar port 30511b41d2SMark Murray.Op Fl V Ar client_protocol_id 31511b41d2SMark Murray.Sh DESCRIPTION 32511b41d2SMark Murray.Nm 33511b41d2SMark Murray(Secure Shell Daemon) is the daemon program for 34511b41d2SMark Murray.Xr ssh 1 . 35e8aafc91SKris KennawayTogether these programs replace rlogin and rsh, and 36511b41d2SMark Murrayprovide secure encrypted communications between two untrusted hosts 373c6ae118SKris Kennawayover an insecure network. 383c6ae118SKris KennawayThe programs are intended to be as easy to 39511b41d2SMark Murrayinstall and use as possible. 40511b41d2SMark Murray.Pp 41511b41d2SMark Murray.Nm 423c6ae118SKris Kennawayis the daemon that listens for connections from clients. 433c6ae118SKris KennawayIt is normally started at boot from 446a8633dbSKris Kennaway.Pa /etc/rc.network . 45511b41d2SMark MurrayIt forks a new 463c6ae118SKris Kennawaydaemon for each incoming connection. 473c6ae118SKris KennawayThe forked daemons handle 48511b41d2SMark Murraykey exchange, encryption, authentication, command execution, 49511b41d2SMark Murrayand data exchange. 50e8aafc91SKris KennawayThis implementation of 51e8aafc91SKris Kennaway.Nm 52e8aafc91SKris Kennawaysupports both SSH protocol version 1 and 2 simultaneously. 53511b41d2SMark Murray.Nm 543c6ae118SKris Kennawayworks as follows. 55e8aafc91SKris Kennaway.Pp 56e8aafc91SKris Kennaway.Ss SSH protocol version 1 57e8aafc91SKris Kennaway.Pp 583c6ae118SKris KennawayEach host has a host-specific RSA key 593c6ae118SKris Kennaway(normally 1024 bits) used to identify the host. 603c6ae118SKris KennawayAdditionally, when 61511b41d2SMark Murraythe daemon starts, it generates a server RSA key (normally 768 bits). 62511b41d2SMark MurrayThis key is normally regenerated every hour if it has been used, and 63511b41d2SMark Murrayis never stored on disk. 64511b41d2SMark Murray.Pp 65e8aafc91SKris KennawayWhenever a client connects the daemon responds with its public 66e8aafc91SKris Kennawayhost and server keys. 673c6ae118SKris KennawayThe client compares the 68e8aafc91SKris KennawayRSA host key against its own database to verify that it has not changed. 693c6ae118SKris KennawayThe client then generates a 256 bit random number. 703c6ae118SKris KennawayIt encrypts this 71511b41d2SMark Murrayrandom number using both the host key and the server key, and sends 723c6ae118SKris Kennawaythe encrypted number to the server. 73e8aafc91SKris KennawayBoth sides then use this 74511b41d2SMark Murrayrandom number as a session key which is used to encrypt all further 753c6ae118SKris Kennawaycommunications in the session. 763c6ae118SKris KennawayThe rest of the session is encrypted 77e8aafc91SKris Kennawayusing a conventional cipher, currently Blowfish or 3DES, with 3DES 78e8aafc91SKris Kennawaybeing used by default. 793c6ae118SKris KennawayThe client selects the encryption algorithm 80511b41d2SMark Murrayto use from those offered by the server. 81511b41d2SMark Murray.Pp 823c6ae118SKris KennawayNext, the server and the client enter an authentication dialog. 833c6ae118SKris KennawayThe client tries to authenticate itself using 84511b41d2SMark Murray.Pa .rhosts 85511b41d2SMark Murrayauthentication, 86511b41d2SMark Murray.Pa .rhosts 87511b41d2SMark Murrayauthentication combined with RSA host 88511b41d2SMark Murrayauthentication, RSA challenge-response authentication, or password 89511b41d2SMark Murraybased authentication. 90511b41d2SMark Murray.Pp 91511b41d2SMark MurrayRhosts authentication is normally disabled 92511b41d2SMark Murraybecause it is fundamentally insecure, but can be enabled in the server 933c6ae118SKris Kennawayconfiguration file if desired. 943c6ae118SKris KennawaySystem security is not improved unless 95511b41d2SMark Murray.Xr rshd 8 , 96511b41d2SMark Murray.Xr rlogind 8 , 97511b41d2SMark Murray.Xr rexecd 8 , 98511b41d2SMark Murrayand 99511b41d2SMark Murray.Xr rexd 8 100511b41d2SMark Murrayare disabled (thus completely disabling 101511b41d2SMark Murray.Xr rlogin 1 102511b41d2SMark Murrayand 103511b41d2SMark Murray.Xr rsh 1 104e8aafc91SKris Kennawayinto the machine). 105e8aafc91SKris Kennaway.Pp 106e8aafc91SKris Kennaway.Ss SSH protocol version 2 107e8aafc91SKris Kennaway.Pp 108e8aafc91SKris KennawayVersion 2 works similar: 109e8aafc91SKris KennawayEach host has a host-specific DSA key used to identify the host. 110e8aafc91SKris KennawayHowever, when the daemon starts, it does not generate a server key. 111e8aafc91SKris KennawayForward security is provided through a Diffie-Hellman key agreement. 112e8aafc91SKris KennawayThis key agreement results in a shared session key. 113e8aafc91SKris KennawayThe rest of the session is encrypted 114e8aafc91SKris Kennawayusing a symmetric cipher, currently 115e8aafc91SKris KennawayBlowfish, 3DES or CAST128 in CBC mode or Arcfour. 116e8aafc91SKris KennawayThe client selects the encryption algorithm 117e8aafc91SKris Kennawayto use from those offered by the server. 118e8aafc91SKris KennawayAdditionally, session integrity is provided 119e8aafc91SKris Kennawaythrough a cryptographic message authentication code 120e8aafc91SKris Kennaway(hmac-sha1 or hmac-md5). 121e8aafc91SKris Kennaway.Pp 122e8aafc91SKris KennawayProtocol version 2 provides a public key based 123e8aafc91SKris Kennawayuser authentication method (DSAAuthentication) 124e8aafc91SKris Kennawayand conventional password authentication. 125e8aafc91SKris Kennaway.Pp 126e8aafc91SKris Kennaway.Ss Command execution and data forwarding 127511b41d2SMark Murray.Pp 128511b41d2SMark MurrayIf the client successfully authenticates itself, a dialog for 1293c6ae118SKris Kennawaypreparing the session is entered. 1303c6ae118SKris KennawayAt this time the client may request 131511b41d2SMark Murraythings like allocating a pseudo-tty, forwarding X11 connections, 132511b41d2SMark Murrayforwarding TCP/IP connections, or forwarding the authentication agent 133511b41d2SMark Murrayconnection over the secure channel. 134511b41d2SMark Murray.Pp 135511b41d2SMark MurrayFinally, the client either requests a shell or execution of a command. 1363c6ae118SKris KennawayThe sides then enter session mode. 1373c6ae118SKris KennawayIn this mode, either side may send 138511b41d2SMark Murraydata at any time, and such data is forwarded to/from the shell or 139511b41d2SMark Murraycommand on the server side, and the user terminal in the client side. 140511b41d2SMark Murray.Pp 141511b41d2SMark MurrayWhen the user program terminates and all forwarded X11 and other 142511b41d2SMark Murrayconnections have been closed, the server sends command exit status to 143511b41d2SMark Murraythe client, and both sides exit. 144511b41d2SMark Murray.Pp 145511b41d2SMark Murray.Nm 146511b41d2SMark Murraycan be configured using command-line options or a configuration 1473c6ae118SKris Kennawayfile. 1483c6ae118SKris KennawayCommand-line options override values specified in the 149511b41d2SMark Murrayconfiguration file. 150511b41d2SMark Murray.Pp 151511b41d2SMark Murray.Nm 152511b41d2SMark Murrayrereads its configuration file when it receives a hangup signal, 153511b41d2SMark Murray.Dv SIGHUP . 154511b41d2SMark Murray.Pp 155511b41d2SMark MurrayThe options are as follows: 156511b41d2SMark Murray.Bl -tag -width Ds 157511b41d2SMark Murray.It Fl b Ar bits 158511b41d2SMark MurraySpecifies the number of bits in the server key (default 768). 159511b41d2SMark Murray.Pp 160511b41d2SMark Murray.It Fl d 1613c6ae118SKris KennawayDebug mode. 1623c6ae118SKris KennawayThe server sends verbose debug output to the system 1633c6ae118SKris Kennawaylog, and does not put itself in the background. 1643c6ae118SKris KennawayThe server also will not fork and will only process one connection. 1653c6ae118SKris KennawayThis option is only intended for debugging for the server. 166511b41d2SMark Murray.It Fl f Ar configuration_file 1673c6ae118SKris KennawaySpecifies the name of the configuration file. 1683c6ae118SKris KennawayThe default is 1692134165cSKris Kennaway.Pa /etc/ssh/sshd_config . 170511b41d2SMark Murray.Nm 171511b41d2SMark Murrayrefuses to start if there is no configuration file. 172511b41d2SMark Murray.It Fl g Ar login_grace_time 173511b41d2SMark MurrayGives the grace time for clients to authenticate themselves (default 1743c6ae118SKris Kennaway300 seconds). 1753c6ae118SKris KennawayIf the client fails to authenticate the user within 1763c6ae118SKris Kennawaythis many seconds, the server disconnects and exits. 1773c6ae118SKris KennawayA value of zero indicates no limit. 178511b41d2SMark Murray.It Fl h Ar host_key_file 179e8aafc91SKris KennawaySpecifies the file from which the RSA host key is read (default 1802134165cSKris Kennaway.Pa /etc/ssh/ssh_host_key ) . 181511b41d2SMark MurrayThis option must be given if 182511b41d2SMark Murray.Nm 183511b41d2SMark Murrayis not run as root (as the normal 184511b41d2SMark Murrayhost file is normally not readable by anyone but root). 185511b41d2SMark Murray.It Fl i 186511b41d2SMark MurraySpecifies that 187511b41d2SMark Murray.Nm 188511b41d2SMark Murrayis being run from inetd. 189511b41d2SMark Murray.Nm 190511b41d2SMark Murrayis normally not run 191511b41d2SMark Murrayfrom inetd because it needs to generate the server key before it can 1923c6ae118SKris Kennawayrespond to the client, and this may take tens of seconds. 1933c6ae118SKris KennawayClients would have to wait too long if the key was regenerated every time. 1943c6ae118SKris KennawayHowever, with small key sizes (e.g., 512) using 195511b41d2SMark Murray.Nm 196511b41d2SMark Murrayfrom inetd may 197511b41d2SMark Murraybe feasible. 198511b41d2SMark Murray.It Fl k Ar key_gen_time 199511b41d2SMark MurraySpecifies how often the server key is regenerated (default 3600 2003c6ae118SKris Kennawayseconds, or one hour). 2013c6ae118SKris KennawayThe motivation for regenerating the key fairly 202511b41d2SMark Murrayoften is that the key is not stored anywhere, and after about an hour, 203511b41d2SMark Murrayit becomes impossible to recover the key for decrypting intercepted 204511b41d2SMark Murraycommunications even if the machine is cracked into or physically 2053c6ae118SKris Kennawayseized. 2063c6ae118SKris KennawayA value of zero indicates that the key will never be regenerated. 207511b41d2SMark Murray.It Fl p Ar port 208511b41d2SMark MurraySpecifies the port on which the server listens for connections 209511b41d2SMark Murray(default 22). 210511b41d2SMark Murray.It Fl q 2113c6ae118SKris KennawayQuiet mode. 2123c6ae118SKris KennawayNothing is sent to the system log. 2133c6ae118SKris KennawayNormally the beginning, 214511b41d2SMark Murrayauthentication, and termination of each connection is logged. 215511b41d2SMark Murray.It Fl Q 216511b41d2SMark MurrayDo not print an error message if RSA support is missing. 217511b41d2SMark Murray.It Fl V Ar client_protocol_id 218511b41d2SMark MurraySSH2 compatibility mode. 219e8aafc91SKris KennawayWhen this option is specified 220511b41d2SMark Murray.Nm 221e8aafc91SKris Kennawayassumes the client has sent the supplied version string 222511b41d2SMark Murrayand skips the 223511b41d2SMark MurrayProtocol Version Identification Exchange. 224511b41d2SMark Murray.It Fl 4 225511b41d2SMark MurrayForces 226511b41d2SMark Murray.Nm 227511b41d2SMark Murrayto use IPv4 addresses only. 228511b41d2SMark Murray.It Fl 6 229511b41d2SMark MurrayForces 230511b41d2SMark Murray.Nm 231511b41d2SMark Murrayto use IPv6 addresses only. 232511b41d2SMark Murray.El 233511b41d2SMark Murray.Sh CONFIGURATION FILE 234511b41d2SMark Murray.Nm 235511b41d2SMark Murrayreads configuration data from 2366a8633dbSKris Kennaway.Pa /etc/ssh/sshd_config 237511b41d2SMark Murray(or the file specified with 238511b41d2SMark Murray.Fl f 2393c6ae118SKris Kennawayon the command line). 2403c6ae118SKris KennawayThe file contains keyword-value pairs, one per line. 2413c6ae118SKris KennawayLines starting with 242511b41d2SMark Murray.Ql # 243511b41d2SMark Murrayand empty lines are interpreted as comments. 244511b41d2SMark Murray.Pp 245511b41d2SMark MurrayThe following keywords are possible. 246511b41d2SMark Murray.Bl -tag -width Ds 247511b41d2SMark Murray.It Cm AFSTokenPassing 2483c6ae118SKris KennawaySpecifies whether an AFS token may be forwarded to the server. 2493c6ae118SKris KennawayDefault is 250511b41d2SMark Murray.Dq yes . 251511b41d2SMark Murray.It Cm AllowGroups 252511b41d2SMark MurrayThis keyword can be followed by a number of group names, separated 2533c6ae118SKris Kennawayby spaces. 2543c6ae118SKris KennawayIf specified, login is allowed only for users whose primary 255511b41d2SMark Murraygroup matches one of the patterns. 256511b41d2SMark Murray.Ql \&* 257511b41d2SMark Murrayand 258511b41d2SMark Murray.Ql ? 259511b41d2SMark Murraycan be used as 2603c6ae118SKris Kennawaywildcards in the patterns. 2613c6ae118SKris KennawayOnly group names are valid, a numerical group ID isn't recognized. 2623c6ae118SKris KennawayBy default login is allowed regardless of the primary group. 263511b41d2SMark Murray.Pp 264511b41d2SMark Murray.It Cm AllowUsers 265511b41d2SMark MurrayThis keyword can be followed by a number of user names, separated 2663c6ae118SKris Kennawayby spaces. 2673c6ae118SKris KennawayIf specified, login is allowed only for users names that 268511b41d2SMark Murraymatch one of the patterns. 269511b41d2SMark Murray.Ql \&* 270511b41d2SMark Murrayand 271511b41d2SMark Murray.Ql ? 272511b41d2SMark Murraycan be used as 2733c6ae118SKris Kennawaywildcards in the patterns. 2743c6ae118SKris KennawayOnly user names are valid, a numerical user ID isn't recognized. 2753c6ae118SKris KennawayBy default login is allowed regardless of the user name. 276511b41d2SMark Murray.Pp 277e8aafc91SKris Kennaway.It Cm Ciphers 278e8aafc91SKris KennawaySpecifies the ciphers allowed for protocol version 2. 279e8aafc91SKris KennawayMultiple ciphers must be comma-separated. 280e8aafc91SKris KennawayThe default is 281e8aafc91SKris Kennaway.Dq 3des-cbc,blowfish-cbc,arcfour,cast128-cbc . 282511b41d2SMark Murray.It Cm CheckMail 283511b41d2SMark MurraySpecifies whether 284511b41d2SMark Murray.Nm 285511b41d2SMark Murrayshould check for new mail for interactive logins. 286511b41d2SMark MurrayThe default is 287511b41d2SMark Murray.Dq no . 28842f71286SMark Murray.It Cm ConnectionsPerPeriod 28942f71286SMark MurrayThis keyword allows for rate-limiting of connections, and 29042f71286SMark Murrayis followed by two numbers in the format 29142f71286SMark Murray.Dq n/s , 29242f71286SMark Murraywhere 29342f71286SMark Murray.Ar n 29442f71286SMark Murrayis the number of connections from a certain address group 29542f71286SMark Murrayaccepted per period of 29642f71286SMark Murray.Ar s 29742f71286SMark Murrayseconds. Any connection after the number 29842f71286SMark Murray.Ar n 29942f71286SMark Murrayconnection in the period of 30042f71286SMark Murray.Ar s 30142f71286SMark Murrayseconds will be dropped, and an informational message will be logged. 30242f71286SMark MurrayA connection will belong to a certain group, of which there are 13 30342f71286SMark Murrayby default, according to its IP address. 30442f71286SMark MurrayThe default for this keyword is 30542f71286SMark Murray.Dq 0/0 , 30642f71286SMark Murrayand rate-limiting can be explicitly turned off by using an 30742f71286SMark Murray.Ar n 30842f71286SMark Murrayparameter of 30942f71286SMark Murray.Ql 0 31042f71286SMark Murrayand any 31142f71286SMark Murray.Ar s 31242f71286SMark Murrayparameter. 313511b41d2SMark Murray.It Cm DenyGroups 314511b41d2SMark MurrayThis keyword can be followed by a number of group names, separated 3153c6ae118SKris Kennawayby spaces. 3163c6ae118SKris KennawayUsers whose primary group matches one of the patterns 317511b41d2SMark Murrayaren't allowed to log in. 318511b41d2SMark Murray.Ql \&* 319511b41d2SMark Murrayand 320511b41d2SMark Murray.Ql ? 321511b41d2SMark Murraycan be used as 3223c6ae118SKris Kennawaywildcards in the patterns. 3233c6ae118SKris KennawayOnly group names are valid, a numerical group ID isn't recognized. 3243c6ae118SKris KennawayBy default login is allowed regardless of the primary group. 325511b41d2SMark Murray.Pp 326511b41d2SMark Murray.It Cm DenyUsers 327511b41d2SMark MurrayThis keyword can be followed by a number of user names, separated 3283c6ae118SKris Kennawayby spaces. 3293c6ae118SKris KennawayLogin is disallowed for user names that match one of the patterns. 330511b41d2SMark Murray.Ql \&* 331511b41d2SMark Murrayand 332511b41d2SMark Murray.Ql ? 3333c6ae118SKris Kennawaycan be used as wildcards in the patterns. 3343c6ae118SKris KennawayOnly user names are valid, a numerical user ID isn't recognized. 3353c6ae118SKris KennawayBy default login is allowed regardless of the user name. 336e8aafc91SKris Kennaway.It Cm DSAAuthentication 337e8aafc91SKris KennawaySpecifies whether DSA authentication is allowed. 338e8aafc91SKris KennawayThe default is 339e8aafc91SKris Kennaway.Dq yes . 340e8aafc91SKris KennawayNote that this option applies to protocol version 2 only. 341e8aafc91SKris Kennaway.It Cm GatewayPorts 342e8aafc91SKris KennawaySpecifies whether remote hosts are allowed to connect to ports 343e8aafc91SKris Kennawayforwarded for the client. 344e8aafc91SKris KennawayThe argument must be 345e8aafc91SKris Kennaway.Dq yes 346e8aafc91SKris Kennawayor 347e8aafc91SKris Kennaway.Dq no . 348e8aafc91SKris KennawayThe default is 349e8aafc91SKris Kennaway.Dq no . 350e8aafc91SKris Kennaway.It Cm HostDsaKey 351e8aafc91SKris KennawaySpecifies the file containing the private DSA host key (default 352e8aafc91SKris Kennaway.Pa /etc/ssh/ssh_host_dsa_key ) 353e8aafc91SKris Kennawayused by SSH protocol 2.0. 354511b41d2SMark MurrayNote that 355511b41d2SMark Murray.Nm 356e8aafc91SKris Kennawaydisables protocol 2.0 if this file is group/world-accessible. 357e8aafc91SKris Kennaway.It Cm HostKey 358e8aafc91SKris KennawaySpecifies the file containing the private RSA host key (default 359e8aafc91SKris Kennaway.Pa /etc/ssh/ssh_host_key ) 360e8aafc91SKris Kennawayused by SSH protocols 1.3 and 1.5. 361e8aafc91SKris KennawayNote that 362e8aafc91SKris Kennaway.Nm 363e8aafc91SKris Kennawaydisables protocols 1.3 and 1.5 if this file is group/world-accessible. 364511b41d2SMark Murray.It Cm IgnoreRhosts 365fe5fd017SMark MurraySpecifies that 366fe5fd017SMark Murray.Pa .rhosts 367fe5fd017SMark Murrayand 368fe5fd017SMark Murray.Pa .shosts 369fe5fd017SMark Murrayfiles will not be used in authentication. 370511b41d2SMark Murray.Pa /etc/hosts.equiv 371511b41d2SMark Murrayand 3722134165cSKris Kennaway.Pa /etc/ssh/shosts.equiv 3733c6ae118SKris Kennawayare still used. 3743c6ae118SKris KennawayThe default is 375fe5fd017SMark Murray.Dq yes . 376511b41d2SMark Murray.It Cm IgnoreUserKnownHosts 377511b41d2SMark MurraySpecifies whether 378511b41d2SMark Murray.Nm 379511b41d2SMark Murrayshould ignore the user's 380511b41d2SMark Murray.Pa $HOME/.ssh/known_hosts 381511b41d2SMark Murrayduring 382511b41d2SMark Murray.Cm RhostsRSAAuthentication . 383511b41d2SMark MurrayThe default is 384511b41d2SMark Murray.Dq no . 385511b41d2SMark Murray.It Cm KeepAlive 386511b41d2SMark MurraySpecifies whether the system should send keepalive messages to the 3873c6ae118SKris Kennawayother side. 3883c6ae118SKris KennawayIf they are sent, death of the connection or crash of one 3893c6ae118SKris Kennawayof the machines will be properly noticed. 3903c6ae118SKris KennawayHowever, this means that 391511b41d2SMark Murrayconnections will die if the route is down temporarily, and some people 3923c6ae118SKris Kennawayfind it annoying. 393e8aafc91SKris KennawayOn the other hand, if keepalives are not sent, 394511b41d2SMark Murraysessions may hang indefinitely on the server, leaving 395511b41d2SMark Murray.Dq ghost 396511b41d2SMark Murrayusers and consuming server resources. 397511b41d2SMark Murray.Pp 398511b41d2SMark MurrayThe default is 399511b41d2SMark Murray.Dq yes 400511b41d2SMark Murray(to send keepalives), and the server will notice 4013c6ae118SKris Kennawayif the network goes down or the client host reboots. 4023c6ae118SKris KennawayThis avoids infinitely hanging sessions. 403511b41d2SMark Murray.Pp 404511b41d2SMark MurrayTo disable keepalives, the value should be set to 405511b41d2SMark Murray.Dq no 406511b41d2SMark Murrayin both the server and the client configuration files. 407511b41d2SMark Murray.It Cm KerberosAuthentication 4083c6ae118SKris KennawaySpecifies whether Kerberos authentication is allowed. 4093c6ae118SKris KennawayThis can be in the form of a Kerberos ticket, or if 410511b41d2SMark Murray.Cm PasswordAuthentication 411511b41d2SMark Murrayis yes, the password provided by the user will be validated through 4123c6ae118SKris Kennawaythe Kerberos KDC. 4133c6ae118SKris KennawayDefault is 414511b41d2SMark Murray.Dq yes . 415511b41d2SMark Murray.It Cm KerberosOrLocalPasswd 416511b41d2SMark MurrayIf set then if password authentication through Kerberos fails then 417511b41d2SMark Murraythe password will be validated via any additional local mechanism 418511b41d2SMark Murraysuch as 419511b41d2SMark Murray.Pa /etc/passwd 4203c6ae118SKris Kennawayor SecurID. 4213c6ae118SKris KennawayDefault is 422511b41d2SMark Murray.Dq yes . 423511b41d2SMark Murray.It Cm KerberosTgtPassing 424511b41d2SMark MurraySpecifies whether a Kerberos TGT may be forwarded to the server. 425511b41d2SMark MurrayDefault is 426511b41d2SMark Murray.Dq no , 427511b41d2SMark Murrayas this only works when the Kerberos KDC is actually an AFS kaserver. 428511b41d2SMark Murray.It Cm KerberosTicketCleanup 429511b41d2SMark MurraySpecifies whether to automatically destroy the user's ticket cache 4303c6ae118SKris Kennawayfile on logout. 4313c6ae118SKris KennawayDefault is 432511b41d2SMark Murray.Dq yes . 433511b41d2SMark Murray.It Cm KeyRegenerationInterval 434511b41d2SMark MurrayThe server key is automatically regenerated after this many seconds 4353c6ae118SKris Kennaway(if it has been used). 4363c6ae118SKris KennawayThe purpose of regeneration is to prevent 437511b41d2SMark Murraydecrypting captured sessions by later breaking into the machine and 4383c6ae118SKris Kennawaystealing the keys. 4393c6ae118SKris KennawayThe key is never stored anywhere. 4403c6ae118SKris KennawayIf the value is 0, the key is never regenerated. 4413c6ae118SKris KennawayThe default is 3600 (seconds). 442511b41d2SMark Murray.It Cm ListenAddress 443511b41d2SMark MurraySpecifies what local address 444511b41d2SMark Murray.Nm 445511b41d2SMark Murrayshould listen on. 446511b41d2SMark MurrayThe default is to listen to all local addresses. 447511b41d2SMark MurrayMultiple options of this type are permitted. 448511b41d2SMark MurrayAdditionally, the 449511b41d2SMark Murray.Cm Ports 450511b41d2SMark Murrayoptions must precede this option. 451511b41d2SMark Murray.It Cm LoginGraceTime 452511b41d2SMark MurrayThe server disconnects after this time if the user has not 4533c6ae118SKris Kennawaysuccessfully logged in. 4543c6ae118SKris KennawayIf the value is 0, there is no time limit. 455511b41d2SMark MurrayThe default is 600 (seconds). 456511b41d2SMark Murray.It Cm LogLevel 457511b41d2SMark MurrayGives the verbosity level that is used when logging messages from 458511b41d2SMark Murray.Nm sshd . 459511b41d2SMark MurrayThe possible values are: 460511b41d2SMark MurrayQUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG. 461511b41d2SMark MurrayThe default is INFO. 462511b41d2SMark MurrayLogging with level DEBUG violates the privacy of users 463511b41d2SMark Murrayand is not recommended. 464511b41d2SMark Murray.It Cm PasswordAuthentication 465511b41d2SMark MurraySpecifies whether password authentication is allowed. 466511b41d2SMark MurrayThe default is 467511b41d2SMark Murray.Dq yes . 468e8aafc91SKris KennawayNote that this option applies to both protocol version 1 and 2. 469511b41d2SMark Murray.It Cm PermitEmptyPasswords 470511b41d2SMark MurrayWhen password authentication is allowed, it specifies whether the 4713c6ae118SKris Kennawayserver allows login to accounts with empty password strings. 4723c6ae118SKris KennawayThe default is 473fe5fd017SMark Murray.Dq no . 474511b41d2SMark Murray.It Cm PermitRootLogin 475511b41d2SMark MurraySpecifies whether the root can log in using 476511b41d2SMark Murray.Xr ssh 1 . 477511b41d2SMark MurrayThe argument must be 478511b41d2SMark Murray.Dq yes , 479511b41d2SMark Murray.Dq without-password 480511b41d2SMark Murrayor 481511b41d2SMark Murray.Dq no . 482511b41d2SMark MurrayThe default is 483511b41d2SMark Murray.Dq yes . 484511b41d2SMark MurrayIf this options is set to 485511b41d2SMark Murray.Dq without-password 486511b41d2SMark Murrayonly password authentication is disabled for root. 487511b41d2SMark Murray.Pp 488511b41d2SMark MurrayRoot login with RSA authentication when the 489511b41d2SMark Murray.Ar command 490511b41d2SMark Murrayoption has been 491511b41d2SMark Murrayspecified will be allowed regardless of the value of this setting 492511b41d2SMark Murray(which may be useful for taking remote backups even if root login is 493511b41d2SMark Murraynormally not allowed). 494e8aafc91SKris Kennaway.It Cm PidFile 495e8aafc91SKris KennawaySpecifies the file that contains the process identifier of the 496e8aafc91SKris Kennaway.Nm 497e8aafc91SKris Kennawaydaemon. 498e8aafc91SKris KennawayThe default is 499e8aafc91SKris Kennaway.Pa /var/run/sshd.pid . 500511b41d2SMark Murray.It Cm Port 501511b41d2SMark MurraySpecifies the port number that 502511b41d2SMark Murray.Nm 5033c6ae118SKris Kennawaylistens on. 5043c6ae118SKris KennawayThe default is 22. 505511b41d2SMark MurrayMultiple options of this type are permitted. 506511b41d2SMark Murray.It Cm PrintMotd 507511b41d2SMark MurraySpecifies whether 508511b41d2SMark Murray.Nm 509511b41d2SMark Murrayshould print 510511b41d2SMark Murray.Pa /etc/motd 5113c6ae118SKris Kennawaywhen a user logs in interactively. 5123c6ae118SKris Kennaway(On some systems it is also printed by the shell, 513511b41d2SMark Murray.Pa /etc/profile , 5143c6ae118SKris Kennawayor equivalent.) 5153c6ae118SKris KennawayThe default is 516511b41d2SMark Murray.Dq yes . 517e8aafc91SKris Kennaway.It Cm Protocol 518e8aafc91SKris KennawaySpecifies the protocol versions 519e8aafc91SKris Kennaway.Nm 520e8aafc91SKris Kennawayshould support. 521e8aafc91SKris KennawayThe possible values are 522e8aafc91SKris Kennaway.Dq 1 523e8aafc91SKris Kennawayand 524e8aafc91SKris Kennaway.Dq 2 . 525e8aafc91SKris KennawayMultiple versions must be comma-separated. 526e8aafc91SKris KennawayThe default is 527e8aafc91SKris Kennaway.Dq 1 . 528511b41d2SMark Murray.It Cm RandomSeed 5296a8633dbSKris KennawayObsolete - accepted and ignored with a warning. 5306a8633dbSKris KennawayRandom number generation uses other techniques. 531511b41d2SMark Murray.It Cm RhostsAuthentication 5326a8633dbSKris KennawaySpecifies whether authentication using rhosts or 5336a8633dbSKris Kennaway.Pa /etc/hosts.equiv 5343c6ae118SKris Kennawayfiles is sufficient. 5353c6ae118SKris KennawayNormally, this method should not be permitted because it is insecure. 536511b41d2SMark Murray.Cm RhostsRSAAuthentication 537511b41d2SMark Murrayshould be used 538511b41d2SMark Murrayinstead, because it performs RSA-based host authentication in addition 5396a8633dbSKris Kennawayto normal rhosts or 5406a8633dbSKris Kennaway.Pa /etc/hosts.equiv 5416a8633dbSKris Kennawayauthentication. 542511b41d2SMark MurrayThe default is 543511b41d2SMark Murray.Dq no . 544511b41d2SMark Murray.It Cm RhostsRSAAuthentication 5456a8633dbSKris KennawaySpecifies whether rhosts or 5466a8633dbSKris Kennaway.Pa /etc/hosts.equiv 5476a8633dbSKris Kennawayauthentication together 5483c6ae118SKris Kennawaywith successful RSA host authentication is allowed. 5493c6ae118SKris KennawayThe default is 550fe5fd017SMark Murray.Dq no . 551511b41d2SMark Murray.It Cm RSAAuthentication 5523c6ae118SKris KennawaySpecifies whether pure RSA authentication is allowed. 5533c6ae118SKris KennawayThe default is 554511b41d2SMark Murray.Dq yes . 555e8aafc91SKris KennawayNote that this option applies to protocol version 1 only. 556511b41d2SMark Murray.It Cm ServerKeyBits 5573c6ae118SKris KennawayDefines the number of bits in the server key. 5583c6ae118SKris KennawayThe minimum value is 512, and the default is 768. 559511b41d2SMark Murray.It Cm SkeyAuthentication 560511b41d2SMark MurraySpecifies whether 561511b41d2SMark Murray.Xr skey 1 5623c6ae118SKris Kennawayauthentication is allowed. 5633c6ae118SKris KennawayThe default is 564511b41d2SMark Murray.Dq yes . 5656a8633dbSKris KennawayNote that OPIE authentication is enabled only if 566511b41d2SMark Murray.Cm PasswordAuthentication 567511b41d2SMark Murrayis allowed, too. 568511b41d2SMark Murray.It Cm StrictModes 569511b41d2SMark MurraySpecifies whether 570511b41d2SMark Murray.Nm 571511b41d2SMark Murrayshould check file modes and ownership of the 5723c6ae118SKris Kennawayuser's files and home directory before accepting login. 5733c6ae118SKris KennawayThis is normally desirable because novices sometimes accidentally leave their 5743c6ae118SKris Kennawaydirectory or files world-writable. 5753c6ae118SKris KennawayThe default is 576511b41d2SMark Murray.Dq yes . 577511b41d2SMark Murray.It Cm SyslogFacility 578511b41d2SMark MurrayGives the facility code that is used when logging messages from 579511b41d2SMark Murray.Nm sshd . 580511b41d2SMark MurrayThe possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 5813c6ae118SKris KennawayLOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 5823c6ae118SKris KennawayThe default is AUTH. 583511b41d2SMark Murray.It Cm UseLogin 584511b41d2SMark MurraySpecifies whether 585511b41d2SMark Murray.Xr login 1 5863c6ae118SKris Kennawayis used. 5873c6ae118SKris KennawayThe default is 588511b41d2SMark Murray.Dq no . 589511b41d2SMark Murray.It Cm X11DisplayOffset 590511b41d2SMark MurraySpecifies the first display number available for 591511b41d2SMark Murray.Nm sshd Ns 's 5923c6ae118SKris KennawayX11 forwarding. 5933c6ae118SKris KennawayThis prevents 594511b41d2SMark Murray.Nm 595511b41d2SMark Murrayfrom interfering with real X11 servers. 596fe5fd017SMark MurrayThe default is 10. 597511b41d2SMark Murray.It Cm X11Forwarding 5983c6ae118SKris KennawaySpecifies whether X11 forwarding is permitted. 5993c6ae118SKris KennawayThe default is 6003c6ae118SKris Kennaway.Dq no . 601511b41d2SMark MurrayNote that disabling X11 forwarding does not improve security in any 602511b41d2SMark Murrayway, as users can always install their own forwarders. 603511b41d2SMark Murray.El 604511b41d2SMark Murray.Sh LOGIN PROCESS 605511b41d2SMark MurrayWhen a user successfully logs in, 606511b41d2SMark Murray.Nm 607511b41d2SMark Murraydoes the following: 608511b41d2SMark Murray.Bl -enum -offset indent 609511b41d2SMark Murray.It 610511b41d2SMark MurrayIf the login is on a tty, and no command has been specified, 611511b41d2SMark Murrayprints last login time and 612511b41d2SMark Murray.Pa /etc/motd 613511b41d2SMark Murray(unless prevented in the configuration file or by 614511b41d2SMark Murray.Pa $HOME/.hushlogin ; 615511b41d2SMark Murraysee the 616511b41d2SMark Murray.Sx FILES 617511b41d2SMark Murraysection). 618511b41d2SMark Murray.It 619511b41d2SMark MurrayIf the login is on a tty, records login time. 620511b41d2SMark Murray.It 621511b41d2SMark MurrayChecks 62242f71286SMark Murray.Pa /etc/nologin and 62342f71286SMark Murray.Pa /var/run/nologin ; 62442f71286SMark Murrayif one exists, it prints the contents and quits 625511b41d2SMark Murray(unless root). 626511b41d2SMark Murray.It 627511b41d2SMark MurrayChanges to run with normal user privileges. 628511b41d2SMark Murray.It 629511b41d2SMark MurraySets up basic environment. 630511b41d2SMark Murray.It 631511b41d2SMark MurrayReads 632511b41d2SMark Murray.Pa $HOME/.ssh/environment 633511b41d2SMark Murrayif it exists. 634511b41d2SMark Murray.It 635511b41d2SMark MurrayChanges to user's home directory. 636511b41d2SMark Murray.It 637511b41d2SMark MurrayIf 638511b41d2SMark Murray.Pa $HOME/.ssh/rc 639511b41d2SMark Murrayexists, runs it; else if 6402134165cSKris Kennaway.Pa /etc/ssh/sshrc 641511b41d2SMark Murrayexists, runs 6426a8633dbSKris Kennawayit; otherwise runs 6436a8633dbSKris Kennaway.Xr xauth 1 . 6446a8633dbSKris KennawayThe 645511b41d2SMark Murray.Dq rc 646511b41d2SMark Murrayfiles are given the X11 6476a8633dbSKris Kennawayauthentication protocol and cookie (if applicable) in standard input. 648511b41d2SMark Murray.It 649511b41d2SMark MurrayRuns user's shell or command. 650511b41d2SMark Murray.El 651511b41d2SMark Murray.Sh AUTHORIZED_KEYS FILE FORMAT 652511b41d2SMark MurrayThe 653511b41d2SMark Murray.Pa $HOME/.ssh/authorized_keys 654511b41d2SMark Murrayfile lists the RSA keys that are 655e8aafc91SKris Kennawaypermitted for RSA authentication in SSH protocols 1.3 and 1.5 656e8aafc91SKris KennawaySimilarly, the 657e8aafc91SKris Kennaway.Pa $HOME/.ssh/authorized_keys2 658e8aafc91SKris Kennawayfile lists the DSA keys that are 659e8aafc91SKris Kennawaypermitted for DSA authentication in SSH protocol 2.0. 6603c6ae118SKris KennawayEach line of the file contains one 661511b41d2SMark Murraykey (empty lines and lines starting with a 662511b41d2SMark Murray.Ql # 663511b41d2SMark Murrayare ignored as 6643c6ae118SKris Kennawaycomments). 6653c6ae118SKris KennawayEach line consists of the following fields, separated by 6663c6ae118SKris Kennawayspaces: options, bits, exponent, modulus, comment. 6673c6ae118SKris KennawayThe options field 668511b41d2SMark Murrayis optional; its presence is determined by whether the line starts 669511b41d2SMark Murraywith a number or not (the option field never starts with a number). 670511b41d2SMark MurrayThe bits, exponent, modulus and comment fields give the RSA key; the 671511b41d2SMark Murraycomment field is not used for anything (but may be convenient for the 672511b41d2SMark Murrayuser to identify the key). 673511b41d2SMark Murray.Pp 674511b41d2SMark MurrayNote that lines in this file are usually several hundred bytes long 6753c6ae118SKris Kennaway(because of the size of the RSA key modulus). 6763c6ae118SKris KennawayYou don't want to type them in; instead, copy the 677511b41d2SMark Murray.Pa identity.pub 678511b41d2SMark Murrayfile and edit it. 679511b41d2SMark Murray.Pp 680511b41d2SMark MurrayThe options (if present) consists of comma-separated option 6813c6ae118SKris Kennawayspecifications. 6823c6ae118SKris KennawayNo spaces are permitted, except within double quotes. 683511b41d2SMark MurrayThe following option specifications are supported: 684511b41d2SMark Murray.Bl -tag -width Ds 685511b41d2SMark Murray.It Cm from="pattern-list" 686511b41d2SMark MurraySpecifies that in addition to RSA authentication, the canonical name 687511b41d2SMark Murrayof the remote host must be present in the comma-separated list of 6883c6ae118SKris Kennawaypatterns 6893c6ae118SKris Kennaway.Pf ( Ql * 6903c6ae118SKris Kennawayand 6913c6ae118SKris Kennaway.Ql ? 6923c6ae118SKris Kennawayserve as wildcards). 6933c6ae118SKris KennawayThe list may also contain 6943c6ae118SKris Kennawaypatterns negated by prefixing them with 6953c6ae118SKris Kennaway.Ql ! ; 6963c6ae118SKris Kennawayif the canonical host name matches a negated pattern, the key is not accepted. 6973c6ae118SKris KennawayThe purpose 698511b41d2SMark Murrayof this option is to optionally increase security: RSA authentication 699511b41d2SMark Murrayby itself does not trust the network or name servers or anything (but 700511b41d2SMark Murraythe key); however, if somebody somehow steals the key, the key 7013c6ae118SKris Kennawaypermits an intruder to log in from anywhere in the world. 7023c6ae118SKris KennawayThis additional option makes using a stolen key more difficult (name 703511b41d2SMark Murrayservers and/or routers would have to be compromised in addition to 704511b41d2SMark Murrayjust the key). 705511b41d2SMark Murray.It Cm command="command" 706511b41d2SMark MurraySpecifies that the command is executed whenever this key is used for 7073c6ae118SKris Kennawayauthentication. 7083c6ae118SKris KennawayThe command supplied by the user (if any) is ignored. 709511b41d2SMark MurrayThe command is run on a pty if the connection requests a pty; 7103c6ae118SKris Kennawayotherwise it is run without a tty. 7113c6ae118SKris KennawayA quote may be included in the command by quoting it with a backslash. 7123c6ae118SKris KennawayThis option might be useful 7133c6ae118SKris Kennawayto restrict certain RSA keys to perform just a specific operation. 7143c6ae118SKris KennawayAn example might be a key that permits remote backups but nothing else. 715e8aafc91SKris KennawayNote that the client may specify TCP/IP and/or X11 716e8aafc91SKris Kennawayforwarding unless they are explicitly prohibited. 717511b41d2SMark Murray.It Cm environment="NAME=value" 718511b41d2SMark MurraySpecifies that the string is to be added to the environment when 7193c6ae118SKris Kennawaylogging in using this key. 7203c6ae118SKris KennawayEnvironment variables set this way 7213c6ae118SKris Kennawayoverride other default environment values. 7223c6ae118SKris KennawayMultiple options of this type are permitted. 723511b41d2SMark Murray.It Cm no-port-forwarding 724511b41d2SMark MurrayForbids TCP/IP forwarding when this key is used for authentication. 7253c6ae118SKris KennawayAny port forward requests by the client will return an error. 7263c6ae118SKris KennawayThis might be used, e.g., in connection with the 727511b41d2SMark Murray.Cm command 728511b41d2SMark Murrayoption. 729511b41d2SMark Murray.It Cm no-X11-forwarding 730511b41d2SMark MurrayForbids X11 forwarding when this key is used for authentication. 731511b41d2SMark MurrayAny X11 forward requests by the client will return an error. 732511b41d2SMark Murray.It Cm no-agent-forwarding 733511b41d2SMark MurrayForbids authentication agent forwarding when this key is used for 734511b41d2SMark Murrayauthentication. 735511b41d2SMark Murray.It Cm no-pty 736511b41d2SMark MurrayPrevents tty allocation (a request to allocate a pty will fail). 737511b41d2SMark Murray.El 738511b41d2SMark Murray.Ss Examples 7396a8633dbSKris Kennaway.Bd -literal 7406a8633dbSKris Kennaway1024 33 12121...312314325 ylo@foo.bar 7416a8633dbSKris Kennawayfrom="*.niksula.hut.fi,!pc.niksula.hut.fi" 1024 35 23...2334 ylo@niksula 7426a8633dbSKris Kennawaycommand="dump /home",no-pty,no-port-forwarding 1024 33 23...2323 backup.hut.fi 7436a8633dbSKris Kennaway.Ed 744511b41d2SMark Murray.Sh SSH_KNOWN_HOSTS FILE FORMAT 745511b41d2SMark MurrayThe 746e8aafc91SKris Kennaway.Pa /etc/ssh/ssh_known_hosts , 747e8aafc91SKris Kennaway.Pa /etc/ssh/ssh_known_hosts2 , 748e8aafc91SKris Kennaway.Pa $HOME/.ssh/known_hosts , 749511b41d2SMark Murrayand 750e8aafc91SKris Kennaway.Pa $HOME/.ssh/known_hosts2 7513c6ae118SKris Kennawayfiles contain host public keys for all known hosts. 7523c6ae118SKris KennawayThe global file should 7535c51cd64SMike Pritchardbe prepared by the administrator (optional), and the per-user file is 754511b41d2SMark Murraymaintained automatically: whenever the user connects an unknown host 755511b41d2SMark Murrayits key is added to the per-user file. 756511b41d2SMark Murray.Pp 757511b41d2SMark MurrayEach line in these files contains the following fields: hostnames, 7583c6ae118SKris Kennawaybits, exponent, modulus, comment. 7593c6ae118SKris KennawayThe fields are separated by spaces. 760511b41d2SMark Murray.Pp 761511b41d2SMark MurrayHostnames is a comma-separated list of patterns ('*' and '?' act as 762511b41d2SMark Murraywildcards); each pattern in turn is matched against the canonical host 763511b41d2SMark Murrayname (when authenticating a client) or against the user-supplied 7643c6ae118SKris Kennawayname (when authenticating a server). 7653c6ae118SKris KennawayA pattern may also be preceded by 766511b41d2SMark Murray.Ql ! 767511b41d2SMark Murrayto indicate negation: if the host name matches a negated 768511b41d2SMark Murraypattern, it is not accepted (by that line) even if it matched another 769511b41d2SMark Murraypattern on the line. 770511b41d2SMark Murray.Pp 771e8aafc91SKris KennawayBits, exponent, and modulus are taken directly from the RSA host key; they 772511b41d2SMark Murraycan be obtained, e.g., from 7732134165cSKris Kennaway.Pa /etc/ssh/ssh_host_key.pub . 774511b41d2SMark MurrayThe optional comment field continues to the end of the line, and is not used. 775511b41d2SMark Murray.Pp 776511b41d2SMark MurrayLines starting with 777511b41d2SMark Murray.Ql # 778511b41d2SMark Murrayand empty lines are ignored as comments. 779511b41d2SMark Murray.Pp 780511b41d2SMark MurrayWhen performing host authentication, authentication is accepted if any 7813c6ae118SKris Kennawaymatching line has the proper key. 7823c6ae118SKris KennawayIt is thus permissible (but not 783511b41d2SMark Murrayrecommended) to have several lines or different host keys for the same 7843c6ae118SKris Kennawaynames. 7853c6ae118SKris KennawayThis will inevitably happen when short forms of host names 7863c6ae118SKris Kennawayfrom different domains are put in the file. 7873c6ae118SKris KennawayIt is possible 788511b41d2SMark Murraythat the files contain conflicting information; authentication is 789511b41d2SMark Murrayaccepted if valid information can be found from either file. 790511b41d2SMark Murray.Pp 791511b41d2SMark MurrayNote that the lines in these files are typically hundreds of characters 792511b41d2SMark Murraylong, and you definitely don't want to type in the host keys by hand. 793511b41d2SMark MurrayRather, generate them by a script 794511b41d2SMark Murrayor by taking 7952134165cSKris Kennaway.Pa /etc/ssh/ssh_host_key.pub 796511b41d2SMark Murrayand adding the host names at the front. 797511b41d2SMark Murray.Ss Examples 7986a8633dbSKris Kennaway.Bd -literal 7996a8633dbSKris Kennawayclosenet,closenet.hut.fi,...,130.233.208.41 1024 37 159...93 closenet.hut.fi 8006a8633dbSKris Kennaway.Ed 801511b41d2SMark Murray.Sh FILES 802511b41d2SMark Murray.Bl -tag -width Ds 8032134165cSKris Kennaway.It Pa /etc/ssh/sshd_config 804511b41d2SMark MurrayContains configuration data for 805511b41d2SMark Murray.Nm sshd . 806511b41d2SMark MurrayThis file should be writable by root only, but it is recommended 807511b41d2SMark Murray(though not necessary) that it be world-readable. 8082134165cSKris Kennaway.It Pa /etc/ssh/ssh_host_key 809511b41d2SMark MurrayContains the private part of the host key. 810511b41d2SMark MurrayThis file should only be owned by root, readable only by root, and not 811511b41d2SMark Murrayaccessible to others. 812511b41d2SMark MurrayNote that 813511b41d2SMark Murray.Nm 814511b41d2SMark Murraydoes not start if this file is group/world-accessible. 8152134165cSKris Kennaway.It Pa /etc/ssh/ssh_host_key.pub 816511b41d2SMark MurrayContains the public part of the host key. 817511b41d2SMark MurrayThis file should be world-readable but writable only by 8183c6ae118SKris Kennawayroot. 8193c6ae118SKris KennawayIts contents should match the private part. 8203c6ae118SKris KennawayThis file is not 821511b41d2SMark Murrayreally used for anything; it is only provided for the convenience of 822511b41d2SMark Murraythe user so its contents can be copied to known hosts files. 823511b41d2SMark MurrayThese two files are created using 824511b41d2SMark Murray.Xr ssh-keygen 1 . 825511b41d2SMark Murray.It Pa /var/run/sshd.pid 826511b41d2SMark MurrayContains the process ID of the 827511b41d2SMark Murray.Nm 828511b41d2SMark Murraylistening for connections (if there are several daemons running 829511b41d2SMark Murrayconcurrently for different ports, this contains the pid of the one 8303c6ae118SKris Kennawaystarted last). 8313c6ae118SKris KennawayThe contents of this file are not sensitive; it can be world-readable. 832511b41d2SMark Murray.It Pa $HOME/.ssh/authorized_keys 833511b41d2SMark MurrayLists the RSA keys that can be used to log into the user's account. 834511b41d2SMark MurrayThis file must be readable by root (which may on some machines imply 835511b41d2SMark Murrayit being world-readable if the user's home directory resides on an NFS 8363c6ae118SKris Kennawayvolume). 8373c6ae118SKris KennawayIt is recommended that it not be accessible by others. 8383c6ae118SKris KennawayThe format of this file is described above. 839e8aafc91SKris KennawayUsers will place the contents of their 840e8aafc91SKris Kennaway.Pa identity.pub 841e8aafc91SKris Kennawayfiles into this file, as described in 842e8aafc91SKris Kennaway.Xr ssh-keygen 1 . 843e8aafc91SKris Kennaway.It Pa $HOME/.ssh/authorized_keys2 844e8aafc91SKris KennawayLists the DSA keys that can be used to log into the user's account. 845e8aafc91SKris KennawayThis file must be readable by root (which may on some machines imply 846e8aafc91SKris Kennawayit being world-readable if the user's home directory resides on an NFS 847e8aafc91SKris Kennawayvolume). 848e8aafc91SKris KennawayIt is recommended that it not be accessible by others. 849e8aafc91SKris KennawayThe format of this file is described above. 850e8aafc91SKris KennawayUsers will place the contents of their 851e8aafc91SKris Kennaway.Pa id_dsa.pub 852e8aafc91SKris Kennawayfiles into this file, as described in 853e8aafc91SKris Kennaway.Xr ssh-keygen 1 . 8542134165cSKris Kennaway.It Pa "/etc/ssh/ssh_known_hosts" and "$HOME/.ssh/known_hosts" 855511b41d2SMark MurrayThese files are consulted when using rhosts with RSA host 8563c6ae118SKris Kennawayauthentication to check the public key of the host. 8573c6ae118SKris KennawayThe key must be listed in one of these files to be accepted. 858511b41d2SMark MurrayThe client uses the same files 8593c6ae118SKris Kennawayto verify that the remote host is the one we intended to connect. 8603c6ae118SKris KennawayThese files should be writable only by root/the owner. 8612134165cSKris Kennaway.Pa /etc/ssh/ssh_known_hosts 862511b41d2SMark Murrayshould be world-readable, and 863511b41d2SMark Murray.Pa $HOME/.ssh/known_hosts 864511b41d2SMark Murraycan but need not be world-readable. 865511b41d2SMark Murray.It Pa /etc/nologin 866511b41d2SMark MurrayIf this file exists, 867511b41d2SMark Murray.Nm 8683c6ae118SKris Kennawayrefuses to let anyone except root log in. 8693c6ae118SKris KennawayThe contents of the file 870511b41d2SMark Murrayare displayed to anyone trying to log in, and non-root connections are 8713c6ae118SKris Kennawayrefused. 8723c6ae118SKris KennawayThe file should be world-readable. 8736a8633dbSKris Kennaway.It Pa /etc/hosts.allow 874511b41d2SMark MurrayIf compiled with 875511b41d2SMark Murray.Sy LIBWRAP 876511b41d2SMark Murraysupport, tcp-wrappers access controls may be defined here as described in 877511b41d2SMark Murray.Xr hosts_access 5 . 878511b41d2SMark Murray.It Pa $HOME/.rhosts 879511b41d2SMark MurrayThis file contains host-username pairs, separated by a space, one per 8803c6ae118SKris Kennawayline. 8813c6ae118SKris KennawayThe given user on the corresponding host is permitted to log in 8823c6ae118SKris Kennawaywithout password. 8833c6ae118SKris KennawayThe same file is used by rlogind and rshd. 884511b41d2SMark MurrayThe file must 885511b41d2SMark Murraybe writable only by the user; it is recommended that it not be 886511b41d2SMark Murrayaccessible by others. 887511b41d2SMark Murray.Pp 8883c6ae118SKris KennawayIf is also possible to use netgroups in the file. 8893c6ae118SKris KennawayEither host or user 890511b41d2SMark Murrayname may be of the form +@groupname to specify all hosts or all users 891511b41d2SMark Murrayin the group. 892511b41d2SMark Murray.It Pa $HOME/.shosts 893511b41d2SMark MurrayFor ssh, 894511b41d2SMark Murraythis file is exactly the same as for 895511b41d2SMark Murray.Pa .rhosts . 896511b41d2SMark MurrayHowever, this file is 897511b41d2SMark Murraynot used by rlogin and rshd, so using this permits access using SSH only. 8986a8633dbSKris Kennaway.It Pa /etc/hosts.equiv 899511b41d2SMark MurrayThis file is used during 900511b41d2SMark Murray.Pa .rhosts 9013c6ae118SKris Kennawayauthentication. 9023c6ae118SKris KennawayIn the simplest form, this file contains host names, one per line. 9033c6ae118SKris KennawayUsers on 904511b41d2SMark Murraythose hosts are permitted to log in without a password, provided they 9053c6ae118SKris Kennawayhave the same user name on both machines. 9063c6ae118SKris KennawayThe host name may also be 907511b41d2SMark Murrayfollowed by a user name; such users are permitted to log in as 908511b41d2SMark Murray.Em any 9093c6ae118SKris Kennawayuser on this machine (except root). 9103c6ae118SKris KennawayAdditionally, the syntax 911511b41d2SMark Murray.Dq +@group 9123c6ae118SKris Kennawaycan be used to specify netgroups. 9133c6ae118SKris KennawayNegated entries start with 914511b41d2SMark Murray.Ql \&- . 915511b41d2SMark Murray.Pp 916511b41d2SMark MurrayIf the client host/user is successfully matched in this file, login is 917511b41d2SMark Murrayautomatically permitted provided the client and server user names are the 9183c6ae118SKris Kennawaysame. 9193c6ae118SKris KennawayAdditionally, successful RSA host authentication is normally required. 9203c6ae118SKris KennawayThis file must be writable only by root; it is recommended 921511b41d2SMark Murraythat it be world-readable. 922511b41d2SMark Murray.Pp 923511b41d2SMark Murray.Sy "Warning: It is almost never a good idea to use user names in" 924511b41d2SMark Murray.Pa hosts.equiv . 925511b41d2SMark MurrayBeware that it really means that the named user(s) can log in as 926511b41d2SMark Murray.Em anybody , 927511b41d2SMark Murraywhich includes bin, daemon, adm, and other accounts that own critical 9283c6ae118SKris Kennawaybinaries and directories. 9293c6ae118SKris KennawayUsing a user name practically grants the user root access. 9303c6ae118SKris KennawayThe only valid use for user names that I can think 931511b41d2SMark Murrayof is in negative entries. 932511b41d2SMark Murray.Pp 933511b41d2SMark MurrayNote that this warning also applies to rsh/rlogin. 9342134165cSKris Kennaway.It Pa /etc/ssh/shosts.equiv 935511b41d2SMark MurrayThis is processed exactly as 936511b41d2SMark Murray.Pa /etc/hosts.equiv . 937511b41d2SMark MurrayHowever, this file may be useful in environments that want to run both 938511b41d2SMark Murrayrsh/rlogin and ssh. 939511b41d2SMark Murray.It Pa $HOME/.ssh/environment 9403c6ae118SKris KennawayThis file is read into the environment at login (if it exists). 9413c6ae118SKris KennawayIt can only contain empty lines, comment lines (that start with 942511b41d2SMark Murray.Ql # ) , 9433c6ae118SKris Kennawayand assignment lines of the form name=value. 9443c6ae118SKris KennawayThe file should be writable 945511b41d2SMark Murrayonly by the user; it need not be readable by anyone else. 946511b41d2SMark Murray.It Pa $HOME/.ssh/rc 9476a8633dbSKris KennawayIf this file exists, it is run with 9486a8633dbSKris Kennaway.Pa /bin/sh 9496a8633dbSKris Kennawayafter reading the 9503c6ae118SKris Kennawayenvironment files but before starting the user's shell or command. 9513c6ae118SKris KennawayIf X11 spoofing is in use, this will receive the "proto cookie" pair in 952511b41d2SMark Murraystandard input (and 953511b41d2SMark Murray.Ev DISPLAY 9543c6ae118SKris Kennawayin environment). 9553c6ae118SKris KennawayThis must call 956511b41d2SMark Murray.Xr xauth 1 957511b41d2SMark Murrayin that case. 958511b41d2SMark Murray.Pp 959511b41d2SMark MurrayThe primary purpose of this file is to run any initialization routines 960511b41d2SMark Murraywhich may be needed before the user's home directory becomes 961511b41d2SMark Murrayaccessible; AFS is a particular example of such an environment. 962511b41d2SMark Murray.Pp 963511b41d2SMark MurrayThis file will probably contain some initialization code followed by 9646a8633dbSKris Kennawaysomething similar to: 9656a8633dbSKris Kennaway.Bd -literal -offset indent 9666a8633dbSKris Kennawayif [ -n "$DISPLAY" ] && read proto cookie; then 9676a8633dbSKris Kennaway echo add $DISPLAY $proto $cookie | xauth -q - 9686a8633dbSKris Kennawayfi 9696a8633dbSKris Kennaway.Ed 970511b41d2SMark Murray.Pp 971511b41d2SMark MurrayIf this file does not exist, 9722134165cSKris Kennaway.Pa /etc/ssh/sshrc 973511b41d2SMark Murrayis run, and if that 9746a8633dbSKris Kennawaydoes not exist either, 9756a8633dbSKris Kennaway.Xr xauth 1 9766a8633dbSKris Kennawayis used to store the cookie. 977511b41d2SMark Murray.Pp 978511b41d2SMark MurrayThis file should be writable only by the user, and need not be 979511b41d2SMark Murrayreadable by anyone else. 9802134165cSKris Kennaway.It Pa /etc/ssh/sshrc 981511b41d2SMark MurrayLike 982511b41d2SMark Murray.Pa $HOME/.ssh/rc . 983511b41d2SMark MurrayThis can be used to specify 9843c6ae118SKris Kennawaymachine-specific login-time initializations globally. 9853c6ae118SKris KennawayThis file should be writable only by root, and should be world-readable. 986511b41d2SMark Murray.Sh AUTHOR 987511b41d2SMark MurrayOpenSSH 988511b41d2SMark Murrayis a derivative of the original (free) ssh 1.2.12 release by Tatu Ylonen, 9893c6ae118SKris Kennawaybut with bugs removed and newer features re-added. 9903c6ae118SKris KennawayRapidly after the 991511b41d2SMark Murray1.2.12 release, newer versions of the original ssh bore successively 992511b41d2SMark Murraymore restrictive licenses, and thus demand for a free version was born. 993e8aafc91SKris Kennaway.Pp 994511b41d2SMark MurrayThis version of OpenSSH 995511b41d2SMark Murray.Bl -bullet 996511b41d2SMark Murray.It 997511b41d2SMark Murrayhas all components of a restrictive nature (i.e., patents, see 998511b41d2SMark Murray.Xr ssl 8 ) 999511b41d2SMark Murraydirectly removed from the source code; any licensed or patented components 1000511b41d2SMark Murrayare chosen from 1001511b41d2SMark Murrayexternal libraries. 1002511b41d2SMark Murray.It 1003e8aafc91SKris Kennawayhas been updated to support SSH protocol 1.5 and 2, making it compatible with 1004e8aafc91SKris Kennawayall other SSH clients and servers. 1005511b41d2SMark Murray.It 1006511b41d2SMark Murraycontains added support for 1007511b41d2SMark Murray.Xr kerberos 8 1008511b41d2SMark Murrayauthentication and ticket passing. 1009511b41d2SMark Murray.It 1010511b41d2SMark Murraysupports one-time password authentication with 1011511b41d2SMark Murray.Xr skey 1 . 1012511b41d2SMark Murray.El 1013511b41d2SMark Murray.Pp 1014511b41d2SMark MurrayThe libraries described in 1015511b41d2SMark Murray.Xr ssl 8 1016511b41d2SMark Murrayare required for proper operation. 1017e8aafc91SKris Kennaway.Pp 1018e8aafc91SKris KennawayOpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl, 1019e8aafc91SKris KennawayNiels Provos, Theo de Raadt, and Dug Song. 1020e8aafc91SKris Kennaway.Pp 1021e8aafc91SKris KennawayThe support for SSH protocol 2 was written by Markus Friedl. 1022511b41d2SMark Murray.Sh SEE ALSO 1023511b41d2SMark Murray.Xr scp 1 , 1024511b41d2SMark Murray.Xr ssh 1 , 1025511b41d2SMark Murray.Xr ssh-add 1 , 1026511b41d2SMark Murray.Xr ssh-agent 1 , 1027511b41d2SMark Murray.Xr ssh-keygen 1 , 1028e8aafc91SKris Kennaway.Xr ssl 8 , 1029e8aafc91SKris Kennaway.Xr rlogin 1 , 1030e8aafc91SKris Kennaway.Xr rsh 1 1031