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