From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: development@lists.ipfire.org Subject: [PATCH 1/2] sshd_config: Do not set defaults explicitly Date: Mon, 20 Jan 2020 20:04:00 +0000 Message-ID: <0026bf7c-a550-0df8-8ee9-ac181047055e@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7351391131049480178==" List-Id: --===============7351391131049480178== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable In order to keep configurations as small as possible and to make them easier to read/audit, this patch omits all default configuration in the OpenSSH server configuration file. Further, it mentions where to refer for the full documentation. Signed-off-by: Peter M=C3=BCller --- config/ssh/sshd_config | 62 ++++++++++++++++--------------------------------= -- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/config/ssh/sshd_config b/config/ssh/sshd_config index a248c4906..bea5cee53 100644 --- a/config/ssh/sshd_config +++ b/config/ssh/sshd_config @@ -1,81 +1,59 @@ -# ultra-secure OpenSSH server configuration +# OpenSSH server configuration file for IPFire +# +# The full documentation is available at: https://man.openbsd.org/sshd_config +# =20 -# only allow version 2 of SSH protocol +# Only allow version 2 of SSH protocol Protocol 2 =20 -# listen on port 22 by default +# Listen on port 22 by default Port 22 =20 -# listen on these interfaces and protocols -AddressFamily any +# Listen on every interface and IPv4 only +AddressFamily inet ListenAddress 0.0.0.0 =20 -# limit authentication thresholds +# Limit authentication timeout to 30 seconds LoginGraceTime 30s -MaxAuthTries 6 =20 -# limit maximum instanctes to prevent DoS +# Limit maximum instanctes to prevent DoS MaxStartups 5 =20 -# ensure proper logging -SyslogFacility AUTH -LogLevel INFO - -# enforce permission checks before a login is accepted -# (prevents damage because of hacked systems with world-writeable -# home directories or similar) -StrictModes yes - -# only allow safe crypto algorithms (may break some _very_ outdated clients) -# see also: https://stribika.github.io/2015/01/04/secure-secure-shell.html +# Only allow safe crypto algorithms (may break some _very_ outdated clients) +# See also: https://stribika.github.io/2015/01/04/secure-secure-shell.html KexAlgorithms curve25519-sha256(a)libssh.org,diffie-hellman-group-exchange-s= ha256 Ciphers chacha20-poly1305(a)openssh.com,aes256-gcm(a)openssh.com,aes128-gcm(= a)openssh.com,aes256-ctr,aes192-ctr,aes128-ctr MACs hmac-sha2-512-etm(a)openssh.com,hmac-sha2-256-etm(a)openssh.com,umac-12= 8-etm(a)openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128(a)openssh.com =20 -# enable data compression after successful login only -Compression delayed - -# only allow cryptographically safe SSH host keys (adjust paths if needed) +# Only allow cryptographically safe SSH host keys (adjust paths if needed) HostKey /etc/ssh/ssh_host_ed25519_key HostKey /etc/ssh/ssh_host_ecdsa_key HostKey /etc/ssh/ssh_host_rsa_key =20 -# only allow login via public key by default +# Only allow login via public key by default PubkeyAuthentication yes PasswordAuthentication no ChallengeResponseAuthentication no -PermitEmptyPasswords no =20 -# permit root login as there is no other user in IPFire 2.x +# Permit root login as there is no other user in IPFire 2.x PermitRootLogin yes =20 -# ignore user ~/.rhost* files -IgnoreRhosts yes - -# ignore user known hosts file +# Ignore user ~/.ssh/known_hosts file IgnoreUserKnownHosts yes =20 -# ignore user environments -PermitUserEnvironment no - -# do not allow any kind of forwarding (provides only low security) +# Do not allow any kind of forwarding (provides only low security); # some of them might need to be re-enabled if SSH server is a jump platform -X11Forwarding no AllowTcpForwarding no AllowAgentForwarding no -PermitTunnel no -GatewayPorts no PermitOpen none =20 -# detect broken sessions by sending keep-alive messages to -# clients (both via TCP and SSH) -TCPKeepAlive yes +# Detect broken sessions by sending keep-alive messages to clients via SSH c= onnection ClientAliveInterval 10 =20 -# close unresponsive SSH sessions which fail to answer keep-alive +# Close unresponsive SSH sessions which fail to answer keep-alive ClientAliveCountMax 6 =20 -# add support for SFTP +# Add support for SFTP Subsystem sftp /usr/lib/openssh/sftp-server =20 # EOF --=20 2.16.4 --===============7351391131049480178==--