xref: /freebsd/crypto/openssh/sshd_config (revision 8e28d84935f2f0ee081d44f9803f3052b960e50b)
1*8e28d849SEd Maste#	$OpenBSD: sshd_config,v 1.105 2024/12/03 14:12:47 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
598be24d80SEd Maste# 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
648be24d80SEd Maste# Change to "no" to disable keyboard-interactive authentication.  Depending on
658be24d80SEd Maste# the system's configuration, this may involve passwords, challenge-response,
668be24d80SEd Maste# one-time passwords or some combination of these and other methods.
678be24d80SEd Maste# Keyboard interactive authentication is also used for PAM authentication.
6819261079SEd Maste#KbdInteractiveAuthentication yes
69511b41d2SMark Murray
70af12a3e7SDag-Erling Smørgrav# Kerberos options
7180628bacSDag-Erling Smørgrav#KerberosAuthentication no
72511b41d2SMark Murray#KerberosOrLocalPasswd yes
73af12a3e7SDag-Erling Smørgrav#KerberosTicketCleanup yes
741ec0d754SDag-Erling Smørgrav#KerberosGetAFSToken no
75511b41d2SMark Murray
76cf2b5f3bSDag-Erling Smørgrav# GSSAPI options
77cf2b5f3bSDag-Erling Smørgrav#GSSAPIAuthentication no
781ec0d754SDag-Erling Smørgrav#GSSAPICleanupCredentials yes
79511b41d2SMark Murray
8021e764dfSDag-Erling Smørgrav# Set this to 'no' to disable PAM authentication, account processing,
8121e764dfSDag-Erling Smørgrav# and session processing. If this is enabled, PAM authentication will
8219261079SEd Maste# be allowed through the KbdInteractiveAuthentication and
83333ee039SDag-Erling Smørgrav# PasswordAuthentication.  Depending on your PAM configuration,
8419261079SEd Maste# PAM authentication via KbdInteractiveAuthentication may bypass
850e12eb7bSEd Maste# the setting of "PermitRootLogin prohibit-password".
86333ee039SDag-Erling Smørgrav# If you just want the PAM account and session checks to run without
87333ee039SDag-Erling Smørgrav# PAM authentication, then enable this but set PasswordAuthentication
8819261079SEd Maste# and KbdInteractiveAuthentication to 'no'.
89d2b1b4f3SDag-Erling Smørgrav#UsePAM yes
90af12a3e7SDag-Erling Smørgrav
91d4af9e69SDag-Erling Smørgrav#AllowAgentForwarding yes
92cf2b5f3bSDag-Erling Smørgrav#AllowTcpForwarding yes
93cf2b5f3bSDag-Erling Smørgrav#GatewayPorts no
9477934b7aSEd Maste#X11Forwarding no
95af12a3e7SDag-Erling Smørgrav#X11DisplayOffset 10
96af12a3e7SDag-Erling Smørgrav#X11UseLocalhost yes
97f7167e0eSDag-Erling Smørgrav#PermitTTY yes
98af12a3e7SDag-Erling Smørgrav#PrintMotd yes
99af12a3e7SDag-Erling Smørgrav#PrintLastLog yes
1001ec0d754SDag-Erling Smørgrav#TCPKeepAlive yes
101f388f5efSDag-Erling Smørgrav#PermitUserEnvironment no
102d4ecd108SDag-Erling Smørgrav#Compression delayed
103cf2b5f3bSDag-Erling Smørgrav#ClientAliveInterval 0
104cf2b5f3bSDag-Erling Smørgrav#ClientAliveCountMax 3
105c4cd1fa4SDag-Erling Smørgrav#UseDNS yes
106cf2b5f3bSDag-Erling Smørgrav#PidFile /var/run/sshd.pid
1076888a9beSDag-Erling Smørgrav#MaxStartups 10:30:100
108b74df5b2SDag-Erling Smørgrav#PermitTunnel no
109d4af9e69SDag-Erling Smørgrav#ChrootDirectory none
110b2af61ecSKurt Lidl#UseBlacklist no
111*8e28d849SEd Maste#VersionAddendum FreeBSD-20250801
112cf2b5f3bSDag-Erling Smørgrav
113af12a3e7SDag-Erling Smørgrav# no default banner path
114d4af9e69SDag-Erling Smørgrav#Banner none
115ca3176e7SBrian Feldman
116af12a3e7SDag-Erling Smørgrav# override default of no subsystems
117ca3176e7SBrian FeldmanSubsystem	sftp	/usr/libexec/sftp-server
118333ee039SDag-Erling Smørgrav
119333ee039SDag-Erling Smørgrav# Example of overriding settings on a per-user basis
120333ee039SDag-Erling Smørgrav#Match User anoncvs
121333ee039SDag-Erling Smørgrav#	X11Forwarding no
122333ee039SDag-Erling Smørgrav#	AllowTcpForwarding no
123f7167e0eSDag-Erling Smørgrav#	PermitTTY no
124333ee039SDag-Erling Smørgrav#	ForceCommand cvs server
125