5
I'm running a Debian server (uname -v
output #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23)
). When I log in from any of several clients (macOS 10.13 laptop with default ssh, the "Prompt" app on iOS, among others), LANG=C
, despite passing in LANG=en_US.UTF-8
from the client. Here is some relevant information:
client$ env | grep LANG
LANG=en_US.UTF-8
client$ ssh -v server
...
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
server$ env | grep LANG
LANG=C
server$ grep -in lang /etc/profile ~/.bash_profile ~/.bash_login ~/.profile ~/.bash_logout ~/.bashrc
grep: ~/.bash_profile: No such file or directory
grep: ~/.bash_login: No such file or directory
server$ locale -a
C
C.UTF-8
POSIX
en_US.utf8
server$ sudo sshd -T | grep acceptenv
acceptenv LANG
acceptenv LC_*
So, ssh
claims to be sending LANG
, sshd
claims to be accepting LANG
, and LANG
is not being set in any of the bash
startup/shutdown files.
I know I could "fix" this with a setting in ~/.profile
or somesuch, but I'm more interested in why the environment isn't getting passed properly.
Edit:
I just noticed that the LANG
name is different on macOS and Debian. This still doesn't work, however:
client$ LANG=en_US.utf8 ssh -v server
...
debug1: Sending environment.
debug1: Sending env LANG = en_US.utf8
server$ env | grep LANG
LANG=C
Edit 2:
This difference in names isn't, it turns out, a Mac-vs-Linux issue. locale -a
reports a different name for the locale than is used by $LANG
. I haven't bothered to investigate why.
1Maybe it is overriden by some profile processing dring the logon on the server? Same problem here between two Ubuntus... LANG seems clobbered but other envvars are carried over correctly. – xenoid – 2018-01-02T00:44:46.213