Bug 2002734

Summary: Disable locale forwarding in OpenSSH
Product: Red Hat Enterprise Linux 9 Reporter: Dmitry Belyavskiy <dbelyavs>
Component: opensshAssignee: Dmitry Belyavskiy <dbelyavs>
Status: CLOSED ERRATA QA Contact: Marek Havrila <mhavrila>
Severity: medium Docs Contact: Jan Fiala <jafiala>
Priority: medium    
Version: 9.0CC: fweimer, jafiala, jjelen, szidek
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
.Locale forwarding disabled by default in OpenSSH Using the `C.UTF-8` locale in small images, such as containers and virtual machines, reduces size and improves performance over using the traditional `en_US.UTF-8` locale. Most distributions send locale environment variables by default and accept them on the server side. However, this meant that logging in through SSH from clients that used locales other than `C` or `C.UTF-8` to servers that did not have the `glibc-langpack-en` or `glibc-all-langpacks` package installed resulted in degraded user experience. Specifically, output in the UTF-8 format was broken and some tools did not work or sent frequent warning messages. With this update, locale forwarding is switched off by default in OpenSSH. This keeps the locale viable even if clients connect to servers with minimal installations that support only a small set of locales.
Story Points: ---
Clone Of:
: 2002739 (view as bug list) Environment:
Last Closed: 2022-05-17 15:53:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2002739    

Description Dmitry Belyavskiy 2021-09-09 15:08:01 UTC
There is a movement towards C.UTF-8 for small images (containers and
VMs).  C.UTF-8 has both size and performance improvements over the more
traditional en_US.UTF-8 locale.  (The performance improvement is
currently in upstream glibc only, but we plan to bring it to rawhide and
Fedora 35 shortly.)

However, in a world where glibc-langpack-en (or glibc-all-langpacks) is
not installed on target systems, logging in over SSH does not result in
a viable locale if the client use en_US.UTF-8 (or any other locale
except C or C.UTF-8).  This causes a severe degradation in user
experience.  It's not only that UTF-8 output does not work, there are
also frequent warning messages from various tools.  Some may even refuse
to run completely.

Most distributions send locale environment variables by default:

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 LANGUAGE
SendEnv XMODIFIERS

And accept them on the server side:

AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS

(Some distributions also use LC_* wildcards.)

Now that servers often use minimal installations which only support a
small set of locales (C, C.UTF-8), it makes sense to discontinue
this practice.

Comment 1 Dmitry Belyavskiy 2021-09-09 16:15:25 UTC
https://lists.mindrot.org/pipermail/openssh-unix-dev/2021-September/039582.html OpenSSH ipstream thread

Comment 2 Carlos O'Donell 2021-09-10 13:30:08 UTC
*** Bug 2000878 has been marked as a duplicate of this bug. ***

Comment 19 errata-xmlrpc 2022-05-17 15:53:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: openssh), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:3949