From 1be272086152ad304149ef56af38a5aaebc8c5ba Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Tue, 2 Feb 2021 13:58:35 +0200 Subject: [PATCH] sshd: explicitly "terminate" Match blocks by Match All https://unix.stackexchange.com/a/303982/17126 & man sshd_config --- etc/ssh/sshd_config.d/anoncvs.conf | 1 + etc/ssh/sshd_config.d/mikaela-prohibit-password.conf | 1 + etc/ssh/sshd_config.d/user-permit-password.conf | 1 + 3 files changed, 3 insertions(+) diff --git a/etc/ssh/sshd_config.d/anoncvs.conf b/etc/ssh/sshd_config.d/anoncvs.conf index be68f108..96450f5d 100644 --- a/etc/ssh/sshd_config.d/anoncvs.conf +++ b/etc/ssh/sshd_config.d/anoncvs.conf @@ -7,3 +7,4 @@ Match User anoncvs,git,gitea AllowTcpForwarding no PermitTTY no # ForceCommand cvs server +Match All diff --git a/etc/ssh/sshd_config.d/mikaela-prohibit-password.conf b/etc/ssh/sshd_config.d/mikaela-prohibit-password.conf index d7022f64..4a2971de 100644 --- a/etc/ssh/sshd_config.d/mikaela-prohibit-password.conf +++ b/etc/ssh/sshd_config.d/mikaela-prohibit-password.conf @@ -2,3 +2,4 @@ Match User mikaela PasswordAuthentication no AuthenticationMethods publickey +Match All diff --git a/etc/ssh/sshd_config.d/user-permit-password.conf b/etc/ssh/sshd_config.d/user-permit-password.conf index 4b7a553d..1b244470 100644 --- a/etc/ssh/sshd_config.d/user-permit-password.conf +++ b/etc/ssh/sshd_config.d/user-permit-password.conf @@ -4,3 +4,4 @@ #Match User someone # PasswordAuthentication yes # AuthenticationMethods any +#Match All