Home | History | Annotate | Line # | Download | only in dist
      1 #	$NetBSD: sshd_config,v 1.31 2026/09/21 21:31:00 christos Exp $
      2 #	$OpenBSD: sshd_config,v 1.106 2026/07/10 17:21:19 naddy Exp $
      3 
      4 # This is the sshd server system-wide configuration file.  See
      5 # sshd_config(5) for more information.
      6 
      7 # The strategy used for options in the default sshd_config shipped with
      8 # OpenSSH is to specify options with their default value where
      9 # possible, but leave them commented.  Uncommented options override the
     10 # default value.
     11 
     12 #Port 22
     13 #AddressFamily any
     14 #ListenAddress 0.0.0.0
     15 #ListenAddress ::
     16 
     17 #HostKey /etc/ssh/ssh_host_rsa_key
     18 #HostKey /etc/ssh/ssh_host_ecdsa_key
     19 #HostKey /etc/ssh/ssh_host_ed25519_key
     20 #HostKey /etc/ssh/ssh_host_mldsa44_ed25519_key
     21 
     22 # Ciphers and keying
     23 #RekeyLimit default none
     24 
     25 # Logging
     26 #SyslogFacility AUTH
     27 #LogLevel INFO
     28 
     29 # Authentication:
     30 
     31 # For slow CPUs, bumped from 2 minutes to 10
     32 LoginGraceTime 600
     33 #PermitRootLogin prohibit-password
     34 #StrictModes yes
     35 #MaxAuthTries 6
     36 #MaxSessions 10
     37 
     38 #PubkeyAuthentication yes
     39 
     40 # The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
     41 # but this is overridden so installations will only check .ssh/authorized_keys
     42 AuthorizedKeysFile	.ssh/authorized_keys
     43 
     44 #AuthorizedPrincipalsFile none
     45 
     46 #AuthorizedKeysCommand none
     47 #AuthorizedKeysCommandUser nobody
     48 
     49 # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
     50 #HostbasedAuthentication no
     51 # Change to yes if you don't trust ~/.ssh/known_hosts for
     52 # HostbasedAuthentication
     53 #IgnoreUserKnownHosts no
     54 # Don't read the user's ~/.rhosts and ~/.shosts files
     55 #IgnoreRhosts yes
     56 
     57 # To disable password authentication, you must BOTH
     58 # (a) set PasswordAuthentication to "no", AND
     59 # (b) set KbdInteractiveAuthentication to "no", or set UsePAM to "no",
     60 #     or disable all password-based auth modules in /etc/pam.d/sshd.
     61 # Alternatively, you can configure AuthenticationMethods with a
     62 # specific list of methods excluding "password" and
     63 # "keyboard-interactive".
     64 #PasswordAuthentication yes
     65 #PermitEmptyPasswords no
     66 
     67 # Change to "no" to disable keyboard-interactive authentication.  Depending on
     68 # the system's configuration, this may involve passwords, challenge-response,
     69 # one-time passwords or some combination of these and other methods.
     70 #KbdInteractiveAuthentication yes
     71 
     72 # Kerberos options
     73 #KerberosAuthentication no
     74 #KerberosOrLocalPasswd yes
     75 #KerberosTicketCleanup yes
     76 #KerberosGetAFSToken no
     77 
     78 # GSSAPI options
     79 #GSSAPIAuthentication no
     80 #GSSAPICleanupCredentials yes
     81 
     82 # Set this to 'yes' to enable PAM authentication, account processing,
     83 # and session processing. If this is enabled, PAM authentication will
     84 # be allowed through the KbdInteractiveAuthentication and
     85 # PasswordAuthentication settings.  Depending on your PAM configuration,
     86 # PAM authentication via KbdInteractiveAuthentication may bypass
     87 # the setting of "PermitRootLogin without-password".
     88 # If you just want the PAM account and session checks to run without
     89 # PAM authentication, then enable this but set PasswordAuthentication
     90 # and KbdInteractiveAuthentication to 'no'.
     91 UsePAM yes
     92 
     93 #AllowAgentForwarding yes
     94 #AllowTcpForwarding yes
     95 #GatewayPorts no
     96 #X11Forwarding no
     97 # If you use xorg from pkgsrc then uncomment the following line.
     98 #XAuthLocation /usr/pkg/bin/xauth
     99 #X11DisplayOffset 10
    100 #X11UseLocalhost yes
    101 #PermitTTY yes
    102 #PrintMotd yes
    103 #PrintLastLog yes
    104 #TCPKeepAlive yes
    105 #PermitUserEnvironment no
    106 #Compression delayed
    107 #ClientAliveInterval 0
    108 #ClientAliveCountMax 3
    109 #UseDNS no
    110 #PidFile /var/run/sshd.pid
    111 #MaxStartups 10:30:100
    112 #PermitTunnel no
    113 #ChrootDirectory none
    114 #VersionAddendum none
    115 
    116 # no default banner path
    117 #Banner none
    118 
    119 # here are the new patched ldap related tokens
    120 # entries in your LDAP must have posixAccount & ldapPublicKey objectclass
    121 #UseLPK yes
    122 #LpkLdapConf /etc/ldap.conf
    123 #LpkServers  ldap://10.1.7.1/ ldap://10.1.7.2/
    124 #LpkUserDN   ou=users,dc=phear,dc=org
    125 #LpkGroupDN  ou=groups,dc=phear,dc=org
    126 #LpkBindDN cn=Manager,dc=phear,dc=org
    127 #LpkBindPw secret
    128 #LpkServerGroup mail
    129 #LpkFilter (hostAccess=master.phear.org)
    130 #LpkForceTLS no
    131 #LpkSearchTimelimit 3
    132 #LpkBindTimelimit 3
    133 #LpkPubKeyAttr sshPublicKey
    134 
    135 # override default of no subsystems
    136 Subsystem	sftp	/usr/libexec/sftp-server
    137 
    138 # the following are HPN related configuration options
    139 # tcp receive buffer polling. disable in non autotuning kernels
    140 #TcpRcvBufPoll yes
    141 
    142 # allow the use of the none cipher
    143 #NoneEnabled no
    144 
    145 # disable hpn performance boosts.
    146 HPNDisabled yes
    147 
    148 # buffer size for hpn to non-hpn connections
    149 #HPNBufferSize 2048
    150 
    151 # Example of overriding settings on a per-user basis
    152 #Match User anoncvs
    153 #	X11Forwarding no
    154 #	AllowTcpForwarding no
    155 #	PermitTTY no
    156 #	ForceCommand cvs server
    157