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.\" 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. 25.\" 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. 36.\" 37.\" $MirOS: src/usr.bin/ssh/sshd_config.5,v 1.28 2009/10/04 14:29:12 tg Exp $ 38.\" $OpenBSD: sshd_config.5,v 1.107 2009/08/16 23:29:26 dtucker Exp $ 39.Dd $Mdocdate: October 4 2009 $ 40.Dt SSHD_CONFIG 5 41.Os 42.Sh NAME 43.Nm sshd_config 44.Nd OpenSSH SSH daemon configuration file 45.Sh SYNOPSIS 46.Nm /etc/ssh/sshd_config 47.Sh DESCRIPTION 48.Xr sshd 8 49reads configuration data from 50.Pa /etc/ssh/sshd_config 51(or the file specified with 52.Fl f 53on the command line). 54The file contains keyword-argument pairs, one per line. 55Lines starting with 56.Ql # 57and empty lines are interpreted as comments. 58Arguments may optionally be enclosed in double quotes 59.Pq \&" 60in order to represent arguments containing spaces. 61.Pp 62The possible 63keywords and their meanings are as follows (note that 64keywords are case-insensitive and arguments are case-sensitive): 65.Bl -tag -width Ds 66.It Cm AcceptEnv 67Specifies what environment variables sent by the client will be copied into 68the session's 69.Xr environ 7 . 70See 71.Cm SendEnv 72in 73.Xr ssh_config 5 74for how to configure the client. 75Note that environment passing is only supported for protocol 2. 76Variables are specified by name, which may contain the wildcard characters 77.Ql * 78and 79.Ql \&? . 80Multiple environment variables may be separated by whitespace or spread 81across multiple 82.Cm AcceptEnv 83directives. 84Be warned that some environment variables could be used to bypass restricted 85user environments. 86For this reason, care should be taken in the use of this directive. 87The default is not to accept any environment variables. 88.It Cm AddressFamily 89Specifies which address family should be used by 90.Xr sshd 8 . 91Valid arguments are 92.Dq any , 93.Dq inet 94(use IPv4 only), or 95.Dq inet6 96(use IPv6 only). 97The default is 98.Dq any . 99.It Cm AllowAgentForwarding 100Specifies whether 101.Xr ssh-agent 1 102forwarding is permitted. 103The default is 104.Dq yes . 105Note that disabling agent forwarding does not improve security 106unless users are also denied shell access, as they can always install 107their own forwarders. 108.It Cm AllowGroups 109This keyword can be followed by a list of group name patterns, separated 110by spaces. 111If specified, login is allowed only for users whose primary 112group or supplementary group list matches one of the patterns. 113Only group names are valid; a numerical group ID is not recognized. 114By default, login is allowed for all groups. 115The allow/deny directives are processed in the following order: 116.Cm DenyUsers , 117.Cm AllowUsers , 118.Cm DenyGroups , 119and finally 120.Cm AllowGroups . 121.Pp 122See 123.Sx PATTERNS 124in 125.Xr ssh_config 5 126for more information on patterns. 127.It Cm AllowTcpForwarding 128Specifies whether TCP forwarding is permitted. 129The default is 130.Dq yes . 131Note that disabling TCP forwarding does not improve security unless 132users are also denied shell access, as they can always install their 133own forwarders. 134.It Cm AllowUsers 135This keyword can be followed by a list of user name patterns, separated 136by spaces. 137If specified, login is allowed only for user names that 138match one of the patterns. 139Only user names are valid; a numerical user ID is not recognized. 140By default, login is allowed for all users. 141If the pattern takes the form USER@HOST then USER and HOST 142are separately checked, restricting logins to particular 143users from particular hosts. 144The allow/deny directives are processed in the following order: 145.Cm DenyUsers , 146.Cm AllowUsers , 147.Cm DenyGroups , 148and finally 149.Cm AllowGroups . 150.Pp 151See 152.Sx PATTERNS 153in 154.Xr ssh_config 5 155for more information on patterns. 156.It Cm AuthorisedKeysFile 157Specifies the file that contains the public keys that can be used 158for user authentication. 159.Cm AuthorisedKeysFile 160may contain tokens of the form %T which are substituted during connection 161setup. 162The following tokens are defined: %% is replaced by a literal '%', 163%h is replaced by the home directory of the user being authenticated, and 164%u is replaced by the username of that user. 165After expansion, 166.Cm AuthorisedKeysFile 167is taken to be an absolute path or one relative to the user's home 168directory. 169The default is 170.Dq .etc/ssh/authorised_keys . 171.It Cm AuthorisedKeysFile2 172Only used for backward compatibility with stock 173.Ox 174OpenSSH. 175This option is deprecated. 176The default is 177.Dq .ssh/authorized_keys 178if 179.Cm AuthorisedKeysFile 180if unset, its value otherwise. 181.It Cm Banner 182The contents of the specified file are sent to the remote user before 183authentication is allowed. 184If the argument is 185.Dq none 186then no banner is displayed. 187This option is only available for protocol version 2. 188By default, no banner is displayed. 189.It Cm ChallengeResponseAuthentication 190Specifies whether challenge-response authentication is allowed. 191All authentication styles from 192.Xr login.conf 5 193are supported. 194The default is 195.Dq yes . 196.It Cm ChrootDirectory 197Specifies a path to 198.Xr chroot 2 199to after authentication. 200This path, and all its components, must be root-owned directories that are 201not writable by any other user or group. 202After the chroot, 203.Xr sshd 8 204changes the working directory to the user's home directory. 205.Pp 206The path may contain the following tokens that are expanded at runtime once 207the connecting user has been authenticated: %% is replaced by a literal '%', 208%h is replaced by the home directory of the user being authenticated, and 209%u is replaced by the username of that user. 210.Pp 211The 212.Cm ChrootDirectory 213must contain the necessary files and directories to support the 214user's session. 215For an interactive session this requires at least a shell, typically 216.Xr sh 1 , 217and basic 218.Pa /dev 219nodes such as 220.Xr null 4 , 221.Xr zero 4 , 222.Xr stdin 4 , 223.Xr stdout 4 , 224.Xr stderr 4 , 225.Xr arandom 4 226and 227.Xr tty 4 228devices. 229For file transfer sessions using 230.Dq sftp , 231no additional configuration of the environment is necessary if the 232in-process sftp server is used, 233though sessions which use logging do require 234.Pa /dev/log 235inside the chroot directory (see 236.Xr sftp-server 8 237for details). 238.Pp 239The default is not to 240.Xr chroot 2 . 241.It Cm Ciphers 242Specifies the ciphers allowed for protocol version 2. 243Multiple ciphers must be comma-separated. 244The supported ciphers are 245.Dq 3des-cbc , 246.Dq aes128-cbc , 247.Dq aes192-cbc , 248.Dq aes256-cbc , 249.Dq aes128-ctr , 250.Dq aes192-ctr , 251.Dq aes256-ctr , 252.Dq arcfour128 , 253.Dq arcfour256 , 254.Dq arcfour , 255.Dq blowfish-cbc , 256and 257.Dq cast128-cbc . 258The default is: 259.Bd -literal -offset 3n 260aes256-ctr,arcfour256,aes256-cbc,cast128-cbc,aes128-cbc, 261blowfish-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr, 262arcfour128,arcfour,aes192-cbc,aes192-ctr,3des-cbc 263.Ed 264.It Cm ClientAliveCountMax 265Sets the number of client alive messages (see below) which may be 266sent without 267.Xr sshd 8 268receiving any messages back from the client. 269If this threshold is reached while client alive messages are being sent, 270sshd will disconnect the client, terminating the session. 271It is important to note that the use of client alive messages is very 272different from 273.Cm TCPKeepAlive 274(below). 275The client alive messages are sent through the encrypted channel 276and therefore will not be spoofable. 277The TCP keepalive option enabled by 278.Cm TCPKeepAlive 279is spoofable. 280The client alive mechanism is valuable when the client or 281server depend on knowing when a connection has become inactive. 282.Pp 283The default value is 3. 284If 285.Cm ClientAliveInterval 286(see below) is set to 15, and 287.Cm ClientAliveCountMax 288is left at the default, unresponsive SSH clients 289will be disconnected after approximately 45 seconds. 290This option applies to protocol version 2 only. 291.It Cm ClientAliveInterval 292Sets a timeout interval in seconds after which if no data has been received 293from the client, 294.Xr sshd 8 295will send a message through the encrypted 296channel to request a response from the client. 297The default 298is 0, indicating that these messages will not be sent to the client. 299This option applies to protocol version 2 only. 300.It Cm Compression 301Specifies whether compression is allowed, or delayed until 302the user has authenticated successfully. 303The argument must be 304.Dq yes , 305.Dq delayed , 306or 307.Dq no . 308The default is 309.Dq delayed . 310.It Cm DenyGroups 311This keyword can be followed by a list of group name patterns, separated 312by spaces. 313Login is disallowed for users whose primary group or supplementary 314group list matches one of the patterns. 315Only group names are valid; a numerical group ID is not recognized. 316By default, login is allowed for all groups. 317The allow/deny directives are processed in the following order: 318.Cm DenyUsers , 319.Cm AllowUsers , 320.Cm DenyGroups , 321and finally 322.Cm AllowGroups . 323.Pp 324See 325.Sx PATTERNS 326in 327.Xr ssh_config 5 328for more information on patterns. 329.It Cm DenyUsers 330This keyword can be followed by a list of user name patterns, separated 331by spaces. 332Login is disallowed for user names that match one of the patterns. 333Only user names are valid; a numerical user ID is not recognized. 334By default, login is allowed for all users. 335If the pattern takes the form USER@HOST then USER and HOST 336are separately checked, restricting logins to particular 337users from particular hosts. 338The allow/deny directives are processed in the following order: 339.Cm DenyUsers , 340.Cm AllowUsers , 341.Cm DenyGroups , 342and finally 343.Cm AllowGroups . 344.Pp 345See 346.Sx PATTERNS 347in 348.Xr ssh_config 5 349for more information on patterns. 350.It Cm ForceCommand 351Forces the execution of the command specified by 352.Cm ForceCommand , 353ignoring any command supplied by the client and 354.Pa ~/.etc/ssh/rc 355if present. 356The command is invoked by using the user's login shell with the -c option. 357This applies to shell, command, or subsystem execution. 358It is most useful inside a 359.Cm Match 360block. 361The command originally supplied by the client is available in the 362.Ev SSH_ORIGINAL_COMMAND 363environment variable. 364Specifying a command of 365.Dq internal-sftp 366will force the use of an in-process sftp server that requires no support 367files when used with 368.Cm ChrootDirectory . 369.It Cm GatewayPorts 370Specifies whether remote hosts are allowed to connect to ports 371forwarded for the client. 372By default, 373.Xr sshd 8 374binds remote port forwardings to the loopback address. 375This prevents other remote hosts from connecting to forwarded ports. 376.Cm GatewayPorts 377can be used to specify that sshd 378should allow remote port forwardings to bind to non-loopback addresses, thus 379allowing other hosts to connect. 380The argument may be 381.Dq no 382to force remote port forwardings to be available to the local host only, 383.Dq yes 384to force remote port forwardings to bind to the wildcard address, or 385.Dq clientspecified 386to allow the client to select the address to which the forwarding is bound. 387The default is 388.Dq no . 389.It Cm HostbasedAuthentication 390Specifies whether rhosts or /etc/hosts.equiv authentication together 391with successful public key client host authentication is allowed 392(host-based authentication). 393This option is similar to 394.Cm RhostsRSAAuthentication 395and applies to protocol version 2 only. 396The default is 397.Dq no . 398.It Cm HostbasedUsesNameFromPacketOnly 399Specifies whether or not the server will attempt to perform a reverse 400name lookup when matching the name in the 401.Pa ~/.shosts , 402.Pa ~/.rhosts , 403and 404.Pa /etc/hosts.equiv 405files during 406.Cm HostbasedAuthentication . 407A setting of 408.Dq yes 409means that 410.Xr sshd 8 411uses the name supplied by the client rather than 412attempting to resolve the name from the TCP connection itself. 413The default is 414.Dq no . 415.It Cm HostKey 416Specifies a file containing a private host key 417used by SSH. 418The default (if they are all commented out) is 419.Pa /etc/ssh/ssh_host_key 420for protocol version 1, and 421.Pa /etc/ssh/ssh_host_rsa_key 422and 423.Pa /etc/ssh/ssh_host_dsa_key 424for protocol version 2. 425Starting with 426.Mx 8 , 427the shipped version only checks for the RSAv2 key. 428Note that 429.Xr sshd 8 430will refuse to use a file if it is group/world-accessible. 431It is possible to have multiple host key files. 432.Dq rsa1 433keys are used for version 1 and 434.Dq dsa 435or 436.Dq rsa 437are used for version 2 of the SSH protocol. 438.It Cm IgnoreRhosts 439Specifies that 440.Pa .rhosts 441and 442.Pa .shosts 443files will not be used in 444.Cm RhostsRSAAuthentication 445or 446.Cm HostbasedAuthentication . 447.Pp 448.Pa /etc/hosts.equiv 449and 450.Pa /etc/shosts.equiv 451are still used. 452The default is 453.Dq yes . 454.It Cm IgnoreUserKnownHosts 455Specifies whether 456.Xr sshd 8 457should ignore the user's 458.Pa ~/.etc/ssh/known_hosts 459during 460.Cm RhostsRSAAuthentication 461or 462.Cm HostbasedAuthentication . 463The default is 464.Dq no . 465.It Cm KeyRegenerationInterval 466In protocol version 1, the ephemeral server key is automatically regenerated 467after this many seconds (if it has been used). 468The purpose of regeneration is to prevent 469decrypting captured sessions by later breaking into the machine and 470stealing the keys. 471The key is never stored anywhere. 472If the value is 0, the key is never regenerated. 473The default is 3600 (seconds). 474.It Cm ListenAddress 475Specifies the local addresses 476.Xr sshd 8 477should listen on. 478The following forms may be used: 479.Pp 480.Bl -item -offset indent -compact 481.It 482.Cm ListenAddress 483.Sm off 484.Ar host No | Ar IPv4_addr No | Ar IPv6_addr 485.Sm on 486.It 487.Cm ListenAddress 488.Sm off 489.Ar host No | Ar IPv4_addr No : Ar port 490.Sm on 491.It 492.Cm ListenAddress 493.Sm off 494.Oo 495.Ar host No | Ar IPv6_addr Oc : Ar port 496.Sm on 497.El 498.Pp 499If 500.Ar port 501is not specified, 502sshd will listen on the address and all prior 503.Cm Port 504options specified. 505The default is to listen on all local addresses. 506Multiple 507.Cm ListenAddress 508options are permitted. 509Additionally, any 510.Cm Port 511options must precede this option for non-port qualified addresses. 512.It Cm LoginGraceTime 513The server disconnects after this time if the user has not 514successfully logged in. 515If the value is 0, there is no time limit. 516The default is 120 seconds. 517.It Cm LogLevel 518Gives the verbosity level that is used when logging messages from 519.Xr sshd 8 . 520The possible values are: 521QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. 522The default is INFO. 523DEBUG and DEBUG1 are equivalent. 524DEBUG2 and DEBUG3 each specify higher levels of debugging output. 525Logging with a DEBUG level violates the privacy of users and is not recommended. 526.It Cm MACs 527Specifies the available MAC (message authentication code) algorithms. 528The MAC algorithm is used in protocol version 2 529for data integrity protection. 530Multiple algorithms must be comma-separated. 531The default is: 532.Bd -literal -offset indent 533umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com, 534hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96 535.Ed 536.It Cm Match 537Introduces a conditional block. 538If all of the criteria on the 539.Cm Match 540line are satisfied, the keywords on the following lines override those 541set in the global section of the config file, until either another 542.Cm Match 543line or the end of the file. 544.Pp 545The arguments to 546.Cm Match 547are one or more criteria-pattern pairs. 548The available criteria are 549.Cm User , 550.Cm Group , 551.Cm Host , 552and 553.Cm Address . 554The match patterns may consist of single entries or comma-separated 555lists and may use the wildcard and negation operators described in the 556.Sx PATTERNS 557section of 558.Xr ssh_config 5 . 559.Pp 560The patterns in an 561.Cm Address 562criteria may additionally contain addresses to match in CIDR 563address/masklen format, e.g.\& 564.Dq 192.0.2.0/24 565or 566.Dq 3ffe:ffff::/32 . 567Note that the mask length provided must be consistent with the address - 568it is an error to specify a mask length that is too long for the address 569or one with bits set in this host portion of the address. 570For example, 571.Dq 192.0.2.0/33 572and 573.Dq 192.0.2.0/8 574respectively. 575.Pp 576Only a subset of keywords may be used on the lines following a 577.Cm Match 578keyword. 579Available keywords are 580.Cm AllowAgentForwarding , 581.Cm AllowTcpForwarding , 582.Cm Banner , 583.Cm ChrootDirectory , 584.Cm ForceCommand , 585.Cm GatewayPorts , 586.Cm GSSAPIAuthentication , 587.Cm HostbasedAuthentication , 588.Cm KbdInteractiveAuthentication , 589.Cm KerberosAuthentication , 590.Cm MaxAuthTries , 591.Cm MaxSessions , 592.Cm PasswordAuthentication , 593.Cm PermitEmptyPasswords , 594.Cm PermitOpen , 595.Cm PermitRootLogin , 596.Cm PubkeyAuthentication , 597.Cm RhostsRSAAuthentication , 598.Cm RSAAuthentication , 599.Cm X11DisplayOffset , 600.Cm X11Forwarding 601and 602.Cm X11UseLocalHost . 603.It Cm MaxAuthTries 604Specifies the maximum number of authentication attempts permitted per 605connection. 606Once the number of failures reaches half this value, 607additional failures are logged. 608The default is 6. 609.It Cm MaxSessions 610Specifies the maximum number of open sessions permitted per network connection. 611The default is 10. 612.It Cm MaxStartups 613Specifies the maximum number of concurrent unauthenticated connections to the 614SSH daemon. 615Additional connections will be dropped until authentication succeeds or the 616.Cm LoginGraceTime 617expires for a connection. 618The default is 10. 619.Pp 620Alternatively, random early drop can be enabled by specifying 621the three colon separated values 622.Dq start:rate:full 623(e.g. "10:30:60"). 624.Xr sshd 8 625will refuse connection attempts with a probability of 626.Dq rate/100 627(30%) 628if there are currently 629.Dq start 630(10) 631unauthenticated connections. 632The probability increases linearly and all connection attempts 633are refused if the number of unauthenticated connections reaches 634.Dq full 635(60). 636.It Cm PasswordAuthentication 637Specifies whether password authentication is allowed. 638The default is 639.Dq yes . 640.It Cm PermitEmptyPasswords 641When password authentication is allowed, it specifies whether the 642server allows login to accounts with empty password strings. 643The default is 644.Dq no . 645.It Cm PermitOpen 646Specifies the destinations to which TCP port forwarding is permitted. 647The forwarding specification must be one of the following forms: 648.Pp 649.Bl -item -offset indent -compact 650.It 651.Cm PermitOpen 652.Sm off 653.Ar host : port 654.Sm on 655.It 656.Cm PermitOpen 657.Sm off 658.Ar IPv4_addr : port 659.Sm on 660.It 661.Cm PermitOpen 662.Sm off 663.Ar \&[ IPv6_addr \&] : port 664.Sm on 665.El 666.Pp 667Multiple forwards may be specified by separating them with whitespace. 668An argument of 669.Dq any 670can be used to remove all restrictions and permit any forwarding requests. 671By default all port forwarding requests are permitted. 672.It Cm PermitRootLogin 673Specifies whether root can log in using 674.Xr ssh 1 . 675The argument must be 676.Dq yes , 677.Dq without-password , 678.Dq forced-commands-only , 679or 680.Dq no . 681The default is 682.Dq no . 683.Pp 684If this option is set to 685.Dq without-password , 686password authentication is disabled for root. 687.Pp 688If this option is set to 689.Dq forced-commands-only , 690root login with public key authentication will be allowed, 691but only if the 692.Ar command 693option has been specified 694(which may be useful for taking remote backups even if root login is 695normally not allowed). 696All other authentication methods are disabled for root. 697.Pp 698If this option is set to 699.Dq no , 700root is not allowed to log in. 701.It Cm PermitTunnel 702Specifies whether 703.Xr tun 4 704device forwarding is allowed. 705The argument must be 706.Dq yes , 707.Dq point-to-point 708(layer 3), 709.Dq ethernet 710(layer 2), or 711.Dq no . 712Specifying 713.Dq yes 714permits both 715.Dq point-to-point 716and 717.Dq ethernet . 718The default is 719.Dq no . 720Use of this option is discouraged in favour of OpenVPN until 721datagram transport is added. 722.It Cm PermitUserEnvironment 723Specifies whether 724.Pa ~/.etc/ssh/environment 725and 726.Cm environment= 727options in 728.Pa ~/.etc/ssh/authorised_keys 729are processed by 730.Xr sshd 8 . 731The default is 732.Dq no . 733Enabling environment processing may enable users to bypass access 734restrictions in some configurations using mechanisms such as 735.Ev LD_PRELOAD . 736.It Cm PidFile 737Specifies the file that contains the process ID of the 738SSH daemon. 739The default is 740.Pa /var/run/sshd.pid . 741.It Cm Port 742Specifies the port number that 743.Xr sshd 8 744listens on. 745The default is 22. 746Multiple options of this type are permitted. 747See also 748.Cm ListenAddress . 749.It Cm PrintLastLog 750Specifies whether 751.Xr sshd 8 752should print the date and time of the last user login when a user logs 753in interactively. 754The default is 755.Dq yes . 756.It Cm PrintMotd 757Specifies whether 758.Xr sshd 8 759should print 760.Pa /etc/motd 761when a user logs in interactively. 762(On some systems it is also printed by the shell, 763.Pa /etc/profile , 764or equivalent.) 765The default is 766.Dq yes . 767.It Cm Protocol 768Specifies the protocol versions 769.Xr sshd 8 770supports. 771The possible values are 772.Sq 1 773and 774.Sq 2 . 775Multiple versions must be comma-separated. 776The default is 777.Dq 2,1 . 778Note that the order of the protocol list does not indicate preference, 779because the client selects among multiple protocol versions offered 780by the server. 781Specifying 782.Dq 2,1 783is identical to 784.Dq 1,2 . 785.It Cm PubkeyAuthentication 786Specifies whether public key authentication is allowed. 787The default is 788.Dq yes . 789Note that this option applies to protocol version 2 only. 790.It Cm RhostsRSAAuthentication 791Specifies whether rhosts or /etc/hosts.equiv authentication together 792with successful RSA host authentication is allowed. 793The default is 794.Dq no . 795This option applies to protocol version 1 only. 796.It Cm RSAAuthentication 797Specifies whether pure RSA authentication is allowed. 798The default is 799.Dq yes . 800This option applies to protocol version 1 only. 801.It Cm ServerKeyBits 802Defines the number of bits in the ephemeral protocol version 1 server key. 803The minimum value is 512, and the default is 1024. 804.It Cm StrictModes 805Specifies whether 806.Xr sshd 8 807should check file modes and ownership of the 808user's files and home directory before accepting login. 809This is normally desirable because novices sometimes accidentally leave their 810directory or files world-writable. 811The default is 812.Dq yes . 813.It Cm Subsystem 814Configures an external subsystem (e.g. file transfer daemon). 815Arguments should be a subsystem name and a command (with optional arguments) 816to execute upon subsystem request. 817.Pp 818The command 819.Xr sftp-server 8 820implements the 821.Dq sftp 822file transfer subsystem. 823.Pp 824Alternately the name 825.Dq internal-sftp 826implements an in-process 827.Dq sftp 828server. 829This may simplify configurations using 830.Cm ChrootDirectory 831to force a different filesystem root on clients. 832.Pp 833By default no subsystems are defined. 834The default configuration file enables the SFTP daemon. 835Note that this option applies to protocol version 2 only. 836.It Cm SyslogFacility 837Gives the facility code that is used when logging messages from 838.Xr sshd 8 . 839The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 840LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 841The default is AUTH. 842.It Cm TCPKeepAlive 843Specifies whether the system should send TCP keepalive messages to the 844other side. 845If they are sent, death of the connection or crash of one 846of the machines will be properly noticed. 847However, this means that 848connections will die if the route is down temporarily, and some people 849find it annoying. 850On the other hand, if TCP keepalives are not sent, 851sessions may hang indefinitely on the server, leaving 852.Dq ghost 853users and consuming server resources. 854.Pp 855The default is 856.Dq yes 857(to send TCP keepalive messages), and the server will notice 858if the network goes down or the client host crashes. 859This avoids infinitely hanging sessions. 860.Pp 861To disable TCP keepalive messages, the value should be set to 862.Dq no . 863.It Cm UseDNS 864Specifies whether 865.Xr sshd 8 866should look up the remote host name and check that 867the resolved host name for the remote IP address maps back to the 868very same IP address. 869The default is 870.Dq yes . 871.It Cm UseLogin 872Specifies whether 873.Xr login 1 874is used for interactive login sessions. 875The default is 876.Dq no . 877Note that 878.Xr login 1 879is never used for remote command execution. 880Note also, that if this is enabled, 881.Cm X11Forwarding 882will be disabled because 883.Xr login 1 884does not know how to handle 885.Xr xauth 1 886cookies. 887If 888.Cm UsePrivilegeSeparation 889is specified, it will be disabled after authentication. 890.It Cm UsePrivilegeSeparation 891Specifies whether 892.Xr sshd 8 893separates privileges by creating an unprivileged child process 894to deal with incoming network traffic. 895After successful authentication, another process will be created that has 896the privilege of the authenticated user. 897The goal of privilege separation is to prevent privilege 898escalation by containing any corruption within the unprivileged processes. 899The default is 900.Dq yes . 901.It Cm X11DisplayOffset 902Specifies the first display number available for 903.Xr sshd 8 Ns 's 904X11 forwarding. 905This prevents sshd from interfering with real X11 servers. 906The default is 10. 907.It Cm X11Forwarding 908Specifies whether X11 forwarding is permitted. 909The argument must be 910.Dq yes 911or 912.Dq no . 913The default is 914.Dq no . 915.Pp 916When X11 forwarding is enabled, there may be additional exposure to 917the server and to client displays if the 918.Xr sshd 8 919proxy display is configured to listen on the wildcard address (see 920.Cm X11UseLocalhost 921below), though this is not the default. 922Additionally, the authentication spoofing and authentication data 923verification and substitution occur on the client side. 924The security risk of using X11 forwarding is that the client's X11 925display server may be exposed to attack when the SSH client requests 926forwarding (see the warnings for 927.Cm ForwardX11 928in 929.Xr ssh_config 5 ) . 930A system administrator may have a stance in which they want to 931protect clients that may expose themselves to attack by unwittingly 932requesting X11 forwarding, which can warrant a 933.Dq no 934setting. 935.Pp 936Note that disabling X11 forwarding does not prevent users from 937forwarding X11 traffic, as users can always install their own forwarders. 938X11 forwarding is automatically disabled if 939.Cm UseLogin 940is enabled. 941.It Cm X11UseLocalhost 942Specifies whether 943.Xr sshd 8 944should bind the X11 forwarding server to the loopback address or to 945the wildcard address. 946By default, 947sshd binds the forwarding server to the loopback address and sets the 948hostname part of the 949.Ev DISPLAY 950environment variable to 951.Dq localhost . 952This prevents remote hosts from connecting to the proxy display. 953However, some older X11 clients may not function with this 954configuration. 955.Cm X11UseLocalhost 956may be set to 957.Dq no 958to specify that the forwarding server should be bound to the wildcard 959address. 960The argument must be 961.Dq yes 962or 963.Dq no . 964The default is 965.Dq yes . 966.It Cm XAuthLocation 967Specifies the full pathname of the 968.Xr xauth 1 969program. 970The default is 971.Pa /usr/X11R6/bin/xauth . 972.El 973.Sh TIME FORMATS 974.Xr sshd 8 975command-line arguments and configuration file options that specify time 976may be expressed using a sequence of the form: 977.Sm off 978.Ar time Op Ar qualifier , 979.Sm on 980where 981.Ar time 982is a positive integer value and 983.Ar qualifier 984is one of the following: 985.Pp 986.Bl -tag -width Ds -compact -offset indent 987.It Aq Cm none 988seconds 989.It Cm s | Cm S 990seconds 991.It Cm m | Cm M 992minutes 993.It Cm h | Cm H 994hours 995.It Cm d | Cm D 996days 997.It Cm w | Cm W 998weeks 999.El 1000.Pp 1001Each member of the sequence is added together to calculate 1002the total time value. 1003.Pp 1004Time format examples: 1005.Pp 1006.Bl -tag -width Ds -compact -offset indent 1007.It 600 1008600 seconds (10 minutes) 1009.It 10m 101010 minutes 1011.It 1h30m 10121 hour 30 minutes (90 minutes) 1013.El 1014.Sh FILES 1015.Bl -tag -width Ds 1016.It Pa /etc/ssh/sshd_config 1017Contains configuration data for 1018.Xr sshd 8 . 1019This file should be writable by root only, but it is recommended 1020(though not necessary) that it be world-readable. 1021.El 1022.Sh SEE ALSO 1023.Xr sshd 8 1024.Sh AUTHORS 1025OpenSSH is a derivative of the original and free 1026ssh 1.2.12 release by Tatu Ylonen. 1027Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, 1028Theo de Raadt and Dug Song 1029removed many bugs, re-added newer features and 1030created OpenSSH. 1031Markus Friedl contributed the support for SSH 1032protocol versions 1.5 and 2.0. 1033Niels Provos and Markus Friedl contributed support 1034for privilege separation. 1035