119261079SEd Maste# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $ 2511b41d2SMark Murray 380628bacSDag-Erling Smørgrav# This is the sshd server system-wide configuration file. See 480628bacSDag-Erling Smørgrav# sshd_config(5) for more information. 5ca3176e7SBrian Feldman 6989dd127SDag-Erling Smørgrav# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin 7989dd127SDag-Erling Smørgrav 8af12a3e7SDag-Erling Smørgrav# The strategy used for options in the default sshd_config shipped with 9af12a3e7SDag-Erling Smørgrav# OpenSSH is to specify options with their default value where 10e146993eSDag-Erling Smørgrav# possible, but leave them commented. Uncommented options override the 11af12a3e7SDag-Erling Smørgrav# default value. 12af12a3e7SDag-Erling Smørgrav 131f334c7bSDag-Erling Smørgrav# Note that some of FreeBSD's defaults differ from OpenBSD's, and 141f334c7bSDag-Erling Smørgrav# FreeBSD has a few additional options. 151f334c7bSDag-Erling Smørgrav 16af12a3e7SDag-Erling Smørgrav#Port 22 17aa49c926SDag-Erling Smørgrav#AddressFamily any 18511b41d2SMark Murray#ListenAddress 0.0.0.0 19511b41d2SMark Murray#ListenAddress :: 2009958426SBrian Feldman 21d4af9e69SDag-Erling Smørgrav#HostKey /etc/ssh/ssh_host_rsa_key 224a421b63SDag-Erling Smørgrav#HostKey /etc/ssh/ssh_host_ecdsa_key 23f7167e0eSDag-Erling Smørgrav#HostKey /etc/ssh/ssh_host_ed25519_key 24af12a3e7SDag-Erling Smørgrav 25e4a9863fSDag-Erling Smørgrav# Ciphers and keying 26e4a9863fSDag-Erling Smørgrav#RekeyLimit default none 27e4a9863fSDag-Erling Smørgrav 28511b41d2SMark Murray# Logging 29af12a3e7SDag-Erling Smørgrav#SyslogFacility AUTH 30af12a3e7SDag-Erling Smørgrav#LogLevel INFO 31511b41d2SMark Murray 32af12a3e7SDag-Erling Smørgrav# Authentication: 33af12a3e7SDag-Erling Smørgrav 34cf2b5f3bSDag-Erling Smørgrav#LoginGraceTime 2m 35b4245df0SDag-Erling Smørgrav#PermitRootLogin no 36af12a3e7SDag-Erling Smørgrav#StrictModes yes 3721e764dfSDag-Erling Smørgrav#MaxAuthTries 6 38d4af9e69SDag-Erling Smørgrav#MaxSessions 10 39af12a3e7SDag-Erling Smørgrav 40af12a3e7SDag-Erling Smørgrav#PubkeyAuthentication yes 41e146993eSDag-Erling Smørgrav 42e146993eSDag-Erling Smørgrav# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 43d93a896eSDag-Erling Smørgrav# but this is overridden so installations will only check .ssh/authorized_keys 44d93a896eSDag-Erling SmørgravAuthorizedKeysFile .ssh/authorized_keys 45af12a3e7SDag-Erling Smørgrav 46462c32cbSDag-Erling Smørgrav#AuthorizedPrincipalsFile none 47462c32cbSDag-Erling Smørgrav 486888a9beSDag-Erling Smørgrav#AuthorizedKeysCommand none 496888a9beSDag-Erling Smørgrav#AuthorizedKeysCommandUser nobody 506888a9beSDag-Erling Smørgrav 51af12a3e7SDag-Erling Smørgrav# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts 52af12a3e7SDag-Erling Smørgrav#HostbasedAuthentication no 53af12a3e7SDag-Erling Smørgrav# Change to yes if you don't trust ~/.ssh/known_hosts for 54ca86bcf2SDag-Erling Smørgrav# HostbasedAuthentication 55af12a3e7SDag-Erling Smørgrav#IgnoreUserKnownHosts no 56cf2b5f3bSDag-Erling Smørgrav# Don't read the user's ~/.rhosts and ~/.shosts files 57cf2b5f3bSDag-Erling Smørgrav#IgnoreRhosts yes 58511b41d2SMark Murray 59b909c84bSDag-Erling Smørgrav# Change to yes to enable built-in password authentication. 609f009e06SEd Maste# Note that passwords may also be accepted via KbdInteractiveAuthentication. 61b909c84bSDag-Erling Smørgrav#PasswordAuthentication no 62af12a3e7SDag-Erling Smørgrav#PermitEmptyPasswords no 63ca3176e7SBrian Feldman 6453282320SDag-Erling Smørgrav# Change to no to disable PAM authentication 6519261079SEd Maste#KbdInteractiveAuthentication yes 66511b41d2SMark Murray 67af12a3e7SDag-Erling Smørgrav# Kerberos options 6880628bacSDag-Erling Smørgrav#KerberosAuthentication no 69511b41d2SMark Murray#KerberosOrLocalPasswd yes 70af12a3e7SDag-Erling Smørgrav#KerberosTicketCleanup yes 711ec0d754SDag-Erling Smørgrav#KerberosGetAFSToken no 72511b41d2SMark Murray 73cf2b5f3bSDag-Erling Smørgrav# GSSAPI options 74cf2b5f3bSDag-Erling Smørgrav#GSSAPIAuthentication no 751ec0d754SDag-Erling Smørgrav#GSSAPICleanupCredentials yes 76511b41d2SMark Murray 7721e764dfSDag-Erling Smørgrav# Set this to 'no' to disable PAM authentication, account processing, 7821e764dfSDag-Erling Smørgrav# and session processing. If this is enabled, PAM authentication will 7919261079SEd Maste# be allowed through the KbdInteractiveAuthentication and 80333ee039SDag-Erling Smørgrav# PasswordAuthentication. Depending on your PAM configuration, 8119261079SEd Maste# PAM authentication via KbdInteractiveAuthentication may bypass 820e12eb7bSEd Maste# the setting of "PermitRootLogin prohibit-password". 83333ee039SDag-Erling Smørgrav# If you just want the PAM account and session checks to run without 84333ee039SDag-Erling Smørgrav# PAM authentication, then enable this but set PasswordAuthentication 8519261079SEd Maste# and KbdInteractiveAuthentication to 'no'. 86d2b1b4f3SDag-Erling Smørgrav#UsePAM yes 87af12a3e7SDag-Erling Smørgrav 88d4af9e69SDag-Erling Smørgrav#AllowAgentForwarding yes 89cf2b5f3bSDag-Erling Smørgrav#AllowTcpForwarding yes 90cf2b5f3bSDag-Erling Smørgrav#GatewayPorts no 9177934b7aSEd Maste#X11Forwarding no 92af12a3e7SDag-Erling Smørgrav#X11DisplayOffset 10 93af12a3e7SDag-Erling Smørgrav#X11UseLocalhost yes 94f7167e0eSDag-Erling Smørgrav#PermitTTY yes 95af12a3e7SDag-Erling Smørgrav#PrintMotd yes 96af12a3e7SDag-Erling Smørgrav#PrintLastLog yes 971ec0d754SDag-Erling Smørgrav#TCPKeepAlive yes 98f388f5efSDag-Erling Smørgrav#PermitUserEnvironment no 99d4ecd108SDag-Erling Smørgrav#Compression delayed 100cf2b5f3bSDag-Erling Smørgrav#ClientAliveInterval 0 101cf2b5f3bSDag-Erling Smørgrav#ClientAliveCountMax 3 102c4cd1fa4SDag-Erling Smørgrav#UseDNS yes 103cf2b5f3bSDag-Erling Smørgrav#PidFile /var/run/sshd.pid 1046888a9beSDag-Erling Smørgrav#MaxStartups 10:30:100 105b74df5b2SDag-Erling Smørgrav#PermitTunnel no 106d4af9e69SDag-Erling Smørgrav#ChrootDirectory none 107b2af61ecSKurt Lidl#UseBlacklist no 108*62df41aeSEd Maste#VersionAddendum FreeBSD-20250219 109cf2b5f3bSDag-Erling Smørgrav 110af12a3e7SDag-Erling Smørgrav# no default banner path 111d4af9e69SDag-Erling Smørgrav#Banner none 112ca3176e7SBrian Feldman 113af12a3e7SDag-Erling Smørgrav# override default of no subsystems 114ca3176e7SBrian FeldmanSubsystem sftp /usr/libexec/sftp-server 115333ee039SDag-Erling Smørgrav 116333ee039SDag-Erling Smørgrav# Example of overriding settings on a per-user basis 117333ee039SDag-Erling Smørgrav#Match User anoncvs 118333ee039SDag-Erling Smørgrav# X11Forwarding no 119333ee039SDag-Erling Smørgrav# AllowTcpForwarding no 120f7167e0eSDag-Erling Smørgrav# PermitTTY no 121333ee039SDag-Erling Smørgrav# ForceCommand cvs server 122