[opensuse] locale handling via ssh
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I handle locale customization via editing the file ~/.i18n. For instance, on my client machine I have: cer@Telcontar:~> cat .i18n # used by /etc/profile.d/lang.sh LC_TIME=en_DK.UTF-8 LC_MONETARY=es_ES@euro LC_NUMERIC=es_ES@euro LC_PAPER=es_ES@euro LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_NAME=es_ES@euro cer@Telcontar:~> And I get the expected result: cer@Telcontar:~> locale LANG=en_US.utf8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=es_ES@euro LC_TIME=en_DK.UTF-8 LC_COLLATE=POSIX LC_MONETARY=es_ES@euro LC_MESSAGES="en_US.utf8" LC_PAPER=es_ES@euro LC_NAME=es_ES@euro LC_ADDRESS="en_US.utf8" LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_IDENTIFICATION="en_US.utf8" LC_ALL= cer@Telcontar:~> Now, on a "remote" machine (actually a virtual vmware machine (all running 42.2)) I write: carlos-e@Eleanor-422:~> cat .i18n # # Add user specific LANG and LC_* variables here # LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES # LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT # LC_IDENTIFICATION LC_ALL # # export LANG=en_US.UTF-8 LANG=es_ES@euro # # Override system wide input method here # # export INPUT_METHOD=scim carlos-e@Eleanor-422:~> But when I login (via ssh) I don't get that locale: carlos-e@Eleanor-422:~> locale LANG=en_US.utf8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=es_ES@euro LC_TIME=en_DK.UTF-8 LC_COLLATE=POSIX LC_MONETARY=es_ES@euro LC_MESSAGES="en_US.utf8" LC_PAPER=es_ES@euro LC_NAME=es_ES@euro LC_ADDRESS="en_US.utf8" LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_IDENTIFICATION="en_US.utf8" LC_ALL= carlos-e@Eleanor-422:~> That is the locale of the client machine! On a local text terminal I get: LANG=es_ES@euro LC_CTYPE="es_ES@euro" LC_NUMERIC="es_ES@euro" LC_TIME="es_ES@euro" LC_COLLATE="es_ES@euro" LC_MONETARY="es_ES@euro" LC_MESSAGES="es_ES@euro" LC_PAPER="es_ES@euro" LC_NAME="es_ES@euro" LC_ADDRESS="es_ES@euro" LC_TELEPHONE="es_ES@euro" LC_MEASUREMENT="es_ES@euro" LC_IDENTIFICATION="es_ES@euro" LC_ALL= which is the expected result. Why do I not get that via SSH, do I have to do something else? ("man ssh" doesn't have any hit on "locale"). - -- Cheers Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAloG+YwACgkQtTMYHG2NR9WunQCgjI33IFBd+yRPk/LlGZRtzGhs 7n0An0ms3WhMxuGQoHRwV9yl7eGCgf20 =m93V -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sat, 11 Nov 2017 14:22:12 +0100 (CET)
"Carlos E. R."
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I handle locale customization via editing the file ~/.i18n. For instance, on my client machine I have:
cer@Telcontar:~> cat .i18n # used by /etc/profile.d/lang.sh LC_TIME=en_DK.UTF-8 LC_MONETARY=es_ES@euro LC_NUMERIC=es_ES@euro LC_PAPER=es_ES@euro LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_NAME=es_ES@euro cer@Telcontar:~>
And I get the expected result:
cer@Telcontar:~> locale LANG=en_US.utf8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=es_ES@euro LC_TIME=en_DK.UTF-8 LC_COLLATE=POSIX LC_MONETARY=es_ES@euro LC_MESSAGES="en_US.utf8" LC_PAPER=es_ES@euro LC_NAME=es_ES@euro LC_ADDRESS="en_US.utf8" LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_IDENTIFICATION="en_US.utf8" LC_ALL= cer@Telcontar:~>
Now, on a "remote" machine (actually a virtual vmware machine (all running 42.2)) I write:
carlos-e@Eleanor-422:~> cat .i18n # # Add user specific LANG and LC_* variables here # LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES # LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT # LC_IDENTIFICATION LC_ALL # # export LANG=en_US.UTF-8
LANG=es_ES@euro
# # Override system wide input method here # # export INPUT_METHOD=scim carlos-e@Eleanor-422:~>
But when I login (via ssh) I don't get that locale:
carlos-e@Eleanor-422:~> locale LANG=en_US.utf8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=es_ES@euro LC_TIME=en_DK.UTF-8 LC_COLLATE=POSIX LC_MONETARY=es_ES@euro LC_MESSAGES="en_US.utf8" LC_PAPER=es_ES@euro LC_NAME=es_ES@euro LC_ADDRESS="en_US.utf8" LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_IDENTIFICATION="en_US.utf8" LC_ALL= carlos-e@Eleanor-422:~>
That is the locale of the client machine!
On a local text terminal I get:
LANG=es_ES@euro LC_CTYPE="es_ES@euro" LC_NUMERIC="es_ES@euro" LC_TIME="es_ES@euro" LC_COLLATE="es_ES@euro" LC_MONETARY="es_ES@euro" LC_MESSAGES="es_ES@euro" LC_PAPER="es_ES@euro" LC_NAME="es_ES@euro" LC_ADDRESS="es_ES@euro" LC_TELEPHONE="es_ES@euro" LC_MEASUREMENT="es_ES@euro" LC_IDENTIFICATION="es_ES@euro" LC_ALL=
which is the expected result.
Why do I not get that via SSH, do I have to do something else?
Because ssh is designed to allow the client to pass their locale settings into the remote session. So if a Frenchman logs into your server, he sees French. I think if you don't want that behaviour then the least intrusive change is to add some locale stuff to the .bash_profile or whatever in your home directory on the server, or if you want more far reaching changes then you can play with SendEnv in ssh_config.
("man ssh" doesn't have any hit on "locale").
I think the right keyword is Env rather than locale -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2017-11-11 at 14:37 -0000, Dave Howorth wrote:
On Sat, 11 Nov 2017 14:22:12 +0100 (CET) "Carlos E. R." <> wrote:
Hi,
I handle locale customization via editing the file ~/.i18n. For instance, on my client machine I have:
cer@Telcontar:~> cat .i18n # used by /etc/profile.d/lang.sh LC_TIME=en_DK.UTF-8 LC_MONETARY=es_ES@euro LC_NUMERIC=es_ES@euro LC_PAPER=es_ES@euro LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_NAME=es_ES@euro cer@Telcontar:~>
And I get the expected result:
cer@Telcontar:~> locale LANG=en_US.utf8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=es_ES@euro LC_TIME=en_DK.UTF-8 LC_COLLATE=POSIX LC_MONETARY=es_ES@euro LC_MESSAGES="en_US.utf8" LC_PAPER=es_ES@euro LC_NAME=es_ES@euro LC_ADDRESS="en_US.utf8" LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_IDENTIFICATION="en_US.utf8" LC_ALL= cer@Telcontar:~>
Now, on a "remote" machine (actually a virtual vmware machine (all running 42.2)) I write:
carlos-e@Eleanor-422:~> cat .i18n # # Add user specific LANG and LC_* variables here # LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES # LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT # LC_IDENTIFICATION LC_ALL # # export LANG=en_US.UTF-8
LANG=es_ES@euro
# # Override system wide input method here # # export INPUT_METHOD=scim carlos-e@Eleanor-422:~>
But when I login (via ssh) I don't get that locale:
carlos-e@Eleanor-422:~> locale LANG=en_US.utf8 LC_CTYPE=en_US.UTF-8 LC_NUMERIC=es_ES@euro LC_TIME=en_DK.UTF-8 LC_COLLATE=POSIX LC_MONETARY=es_ES@euro LC_MESSAGES="en_US.utf8" LC_PAPER=es_ES@euro LC_NAME=es_ES@euro LC_ADDRESS="en_US.utf8" LC_TELEPHONE=es_ES@euro LC_MEASUREMENT=es_ES@euro LC_IDENTIFICATION="en_US.utf8" LC_ALL= carlos-e@Eleanor-422:~>
That is the locale of the client machine!
On a local text terminal I get:
LANG=es_ES@euro LC_CTYPE="es_ES@euro" LC_NUMERIC="es_ES@euro" LC_TIME="es_ES@euro" LC_COLLATE="es_ES@euro" LC_MONETARY="es_ES@euro" LC_MESSAGES="es_ES@euro" LC_PAPER="es_ES@euro" LC_NAME="es_ES@euro" LC_ADDRESS="es_ES@euro" LC_TELEPHONE="es_ES@euro" LC_MEASUREMENT="es_ES@euro" LC_IDENTIFICATION="es_ES@euro" LC_ALL=
which is the expected result.
Why do I not get that via SSH, do I have to do something else?
Because ssh is designed to allow the client to pass their locale settings into the remote session. So if a Frenchman logs into your server, he sees French.
I think if you don't want that behaviour then the least intrusive change is to add some locale stuff to the .bash_profile or whatever in your home directory on the server, or if you want more far reaching changes then you can play with SendEnv in ssh_config.
It is ignored. The canonical way is to add that stuff to the ".i18n" file, but it is not read on ssh sessions - that's what the OP is about. It is possible that this is a bug.
("man ssh" doesn't have any hit on "locale").
I think the right keyword is Env rather than locale
Mmmm.... - -- Cheers, Carlos E. R. (from openSUSE 42.2 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAloHgjUACgkQtTMYHG2NR9VmAgCffavmcKUJDJRo+9/NZHTPA8pF 84MAnR8EpqgD/TAK4JPTPv8QbAGAd++2 =IuVA -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 12 Nov 2017 00:05:25 +0100 (CET)
"Carlos E. R."
I think if you don't want that behaviour then the least intrusive change is to add some locale stuff to the .bash_profile or whatever in your home directory on the server, or if you want more far reaching changes then you can play with SendEnv in ssh_config.
It is ignored. The canonical way is to add that stuff to the ".i18n" file, but it is not read on ssh sessions - that's what the OP is about. It is possible that this is a bug.
But it worked when Andrei suggested it and you actually tried it! And as you correctly observe .i18n is NOT the canonical way for ssh.
("man ssh" doesn't have any hit on "locale").
I think the right keyword is Env rather than locale
Mmmm....
- -- Cheers, Carlos E. R. (from openSUSE 42.2 x86_64 "Malachite" at Telcontar)
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2017-11-13 at 11:11 -0000, Dave Howorth wrote:
On Sun, 12 Nov 2017 00:05:25 +0100 (CET) "Carlos E. R." <> wrote:
I think if you don't want that behaviour then the least intrusive change is to add some locale stuff to the .bash_profile or whatever in your home directory on the server, or if you want more far reaching changes then you can play with SendEnv in ssh_config.
It is ignored. The canonical way is to add that stuff to the ".i18n" file, but it is not read on ssh sessions - that's what the OP is about. It is possible that this is a bug.
But it worked when Andrei suggested it and you actually tried it! And as you correctly observe .i18n is NOT the canonical way for ssh.
Yes, .i18n on the host does work if you clear the SendEnv setting in the client config file (system wide), as Andrei suggested. - -- Cheers, Carlos E. R. (from openSUSE 42.2 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAloJgBgACgkQtTMYHG2NR9UZqACfYU6uux5L8XNKQoxh+VZQ8E33 vGoAn2w5xeWzi+ZX2Yc64DvWu9J41ADc =eyMd -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, Nov 13, 2017 at 2:11 PM, Dave Howorth
And as you correctly observe .i18n is NOT the canonical way for ssh.
Define "canonical way". ~/.i18n is still processed for ssh sessions just as for others, just SUSE explicitly checks whether locale variables are already defined and skips setting them. It is different from e.g. Ubuntu which does send locale variables by default but lets local settings take precedence. You can also "fix" it on server side by adding suitable /etc/profile.d snippet. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-11-13 12:40, Andrei Borzenkov wrote:
On Mon, Nov 13, 2017 at 2:11 PM, Dave Howorth
wrote: And as you correctly observe .i18n is NOT the canonical way for ssh.
Define "canonical way". ~/.i18n is still processed for ssh sessions just as for others, just SUSE explicitly checks whether locale variables are already defined and skips setting them. It is different from e.g. Ubuntu which does send locale variables by default but lets local settings take precedence.
You can also "fix" it on server side by adding suitable /etc/profile.d snippet.
Someone somewhere decided that the file ~/.i18n is the correct place for language settings per user. It works fine in the local terminal, and some desktops like XFCE honour it, at least in part (openSUSE does not honour it for LANG (except in console), I have a bugzilla about that). SSH honours it as soon as you remove openSUSE SendEnv in /etc/ssh/ssh_config -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
11.11.2017 16:22, Carlos E. R. пишет:
Why do I not get that via SSH, do I have to do something else?
This is default system-wide SUSE configuration that I hate for as long as I work with it. It is configured to pass locale environment variables by default; unfortunately ssh does not offer any way to override it on per-host basis - I can only add more variables, but not remove existing ones.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2017-11-11 at 18:38 +0300, Andrei Borzenkov wrote:
11.11.2017 16:22, Carlos E. R. пишет:
Why do I not get that via SSH, do I have to do something else?
This is default system-wide SUSE configuration that I hate for as long as I work with it. It is configured to pass locale environment variables by default; unfortunately ssh does not offer any way to override it on per-host basis - I can only add more variables, but not remove existing ones.
Oh, crumbs. I saw a "SSH_SENDS_LOCALE" variable used in /etc/profile.d/lang.sh, but doesn't seem to work for this purpose. - -- Cheers, Carlos E. R. (from openSUSE 42.2 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAloHgYEACgkQtTMYHG2NR9WX+QCeMKx7ehj1k6YeDGTdXzj3ne+5 kiQAn219KyUourGgYObVZxj32yEPCxUP =/f5a -----END PGP SIGNATURE-----
12.11.2017 02:02, Carlos E. R. пишет:
On Saturday, 2017-11-11 at 18:38 +0300, Andrei Borzenkov wrote:
11.11.2017 16:22, Carlos E. R. пишет:
Why do I not get that via SSH, do I have to do something else?
This is default system-wide SUSE configuration that I hate for as long as I work with it. It is configured to pass locale environment variables by default; unfortunately ssh does not offer any way to override it on per-host basis - I can only add more variables, but not remove existing ones.
Oh, crumbs.
I saw a "SSH_SENDS_LOCALE" variable used in /etc/profile.d/lang.sh, but doesn't seem to work for this purpose.
Edit /etc/ssh/ssh_config and remove SendEnv.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday, 2017-11-12 at 08:26 +0300, Andrei Borzenkov wrote:
12.11.2017 02:02, Carlos E. R. пишет:
I saw a "SSH_SENDS_LOCALE" variable used in /etc/profile.d/lang.sh, but doesn't seem to work for this purpose.
Edit /etc/ssh/ssh_config and remove SendEnv.
Thanks. Usually I don't need that, but for ocassions like this it will do. Oh! Very interesting! :-O # This enables sending locale enviroment variables LC_* LANG, see ssh_config(5). SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT SendEnv LC_IDENTIFICATION LC_ALL Commented out this instant! I didn't know that it specified individual vars! :-o - -- Cheers, Carlos E. R. (from openSUSE 42.2 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAloIY18ACgkQtTMYHG2NR9UirgCfRulU0jRhl6Pc0r0p1DY6Y0a2 0Z4AniXdvBFKFC6c2kbE2B/e3W0v+eum =3p7P -----END PGP SIGNATURE-----
participants (3)
-
Andrei Borzenkov
-
Carlos E. R.
-
Dave Howorth