From a98b4207e6201f74c3979df2ba6e1532b386bc2d Mon Sep 17 00:00:00 2001 From: Ognjen Djukic Date: Mon, 26 Oct 2026 14:36:49 +0100 Subject: [PATCH] VPS bootstrap: stop accepting the client's locale over SSH Debian's sshd_config has AcceptEnv LANG LC_*, so a PC with e.g. en_GB.UTF-8 makes bash print setlocale warnings on every login because only en_US.UTF-8 is generated on the server. Comment out AcceptEnv during hardening so the server keeps its own locale. --- bootstrap-vps-ssh.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bootstrap-vps-ssh.sh b/bootstrap-vps-ssh.sh index ee3e370..c3b0cf2 100755 --- a/bootstrap-vps-ssh.sh +++ b/bootstrap-vps-ssh.sh @@ -385,6 +385,11 @@ set_sshd_option ChallengeResponseAuthentication no set_sshd_option PubkeyAuthentication yes set_sshd_option UsePAM no +# Debian accepts LANG/LC_* from the client; a PC locale that is not generated +# here (e.g. en_GB.UTF-8) gives setlocale warnings on every login. The server +# uses its own en_US.UTF-8 (generated below) instead. +sed -i 's/^[[:space:]]*AcceptEnv[[:space:]]/#&/' "${SSHD}" + if [[ "${KEEP_ROOT}" == "yes" ]]; then set_sshd_option PermitRootLogin prohibit-password else -- 2.52.0