Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Fedora sshd_config locale

Devuan includes this by default, but Fedora does not. There's probably good reasons. I'll take "Upstream doesn't package it that way" as a good reason!

files/2023/12/listings/allow-ssh-locale.sh (Source)

#!/bin/sh
# Startdate: 2023-12-14-5 10:17
# Reference:
#    https://stackoverflow.com/questions/29609371/how-not-to-pass-the-locale-through-an-ssh-connection-command
# Documentation:
#    Not needed for Devuan because this AcceptEnv is already in the default file sshd_config
tf="/etc/ssh/sshd_config.d/30-locale.conf"
test ! -f "${tf}" && touch "${tf}"
grep -qE '^AcceptEnv.*LC_\*' "${tf}" 1>/dev/null 2>&1 || {
   printf "%s\n" 'AcceptEnv LANG LC_*' >> "${tf}"
   systemctl reload sshd
}

Comments