]> git.ipfire.org Git - people/ms/ipfire-2.x.git/blob - config/ssh/sshd_config
sshd_config: Do not set defaults explicitly
[people/ms/ipfire-2.x.git] / config / ssh / sshd_config
1 # OpenSSH server configuration file for IPFire
2 #
3 # The full documentation is available at: https://man.openbsd.org/sshd_config
4 #
5
6 # Only allow version 2 of SSH protocol
7 Protocol 2
8
9 # Listen on port 22 by default
10 Port 22
11
12 # Listen on every interface and IPv4 only
13 AddressFamily inet
14 ListenAddress 0.0.0.0
15
16 # Limit authentication timeout to 30 seconds
17 LoginGraceTime 30s
18
19 # Limit maximum instanctes to prevent DoS
20 MaxStartups 5
21
22 # Only allow safe crypto algorithms (may break some _very_ outdated clients)
23 # See also: https://stribika.github.io/2015/01/04/secure-secure-shell.html
24 KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
25 Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
26 MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
27
28 # Only allow cryptographically safe SSH host keys (adjust paths if needed)
29 HostKey /etc/ssh/ssh_host_ed25519_key
30 HostKey /etc/ssh/ssh_host_ecdsa_key
31 HostKey /etc/ssh/ssh_host_rsa_key
32
33 # Only allow login via public key by default
34 PubkeyAuthentication yes
35 PasswordAuthentication no
36 ChallengeResponseAuthentication no
37
38 # Permit root login as there is no other user in IPFire 2.x
39 PermitRootLogin yes
40
41 # Ignore user ~/.ssh/known_hosts file
42 IgnoreUserKnownHosts yes
43
44 # Do not allow any kind of forwarding (provides only low security);
45 # some of them might need to be re-enabled if SSH server is a jump platform
46 AllowTcpForwarding no
47 AllowAgentForwarding no
48 PermitOpen none
49
50 # Detect broken sessions by sending keep-alive messages to clients via SSH connection
51 ClientAliveInterval 10
52
53 # Close unresponsive SSH sessions which fail to answer keep-alive
54 ClientAliveCountMax 6
55
56 # Add support for SFTP
57 Subsystem sftp /usr/lib/openssh/sftp-server
58
59 # EOF