[CentOS] Set LANG on CentOS 6 server

Sat Feb 24 13:30:04 UTC 2018
Pete Biggs <pete at biggs.org.uk>

On Sat, 2018-02-24 at 12:43 +0100, Nicolas Kovacs wrote:
> Le 24/02/2018 à 10:33, Nicolas Kovacs a écrit :
> > I replaced fr_FR.UTF8 in /etc/sysconfig/i18n and /boot/grub/grub.conf.
> > Unfortunately, when I reboot the system, I still get this:
> > 
> > # echo $LANG
> > fr_FR.UTF-8
> > 
> > Any suggestions?
> 
> OK, so after some more googling, I found out that when I ssh into my
> server, LANG gets passed on from my desktop to my server. Interesting.

Yes. If you look in /etc/ssh/sshd_config on the server there should be
a list of environment variables that are accepted and in
/etc/ssh/ssh_config on the client there should be a similar list of
ones that are sent. (Actual location and name of the files depends on
your particular distros.)

> 
> So I just added the LANG definition to ~/.bashrc on the server to solve
> the problem.
> 
A more elegant (dare I say proper) way of doing it is to create a
~/.ssh/config on your client and put in it a modified 'SendEnv' for
that host (or don't have a SendEnv if you don't want any env variables
sent).

You can see what variables are being passed if you use the '-v' option
to ssh - and you can see if they are being accepted with '-vv'.

You can also, if you want, modify sshd_config on the server to not
accept the LANG and LC* variables.

P.