How to set user interface language for user with encrypted home?

After encrypting home directory by means of ecryptfs tool specified UI language is not applied after system restart.

If user in the system only one the whole system UI can be changed to needed one. But what to do if there are more than two users and the languages for them must be different?

1 Answer

Configuration of UI language for user is stored in home directory in file .pam_environment (Ubuntu 20.04):

LANGUAGE DEFAULT=en_US:en
LANG DEFAULT=en_US.UTF-8
LC_NUMERIC DEFAULT=ru_RU.UTF-8
LC_TIME DEFAULT=ru_RU.UTF-8
LC_MONETARY DEFAULT=ru_RU.UTF-8
LC_PAPER DEFAULT=ru_RU.UTF-8
LC_NAME DEFAULT=ru_RU.UTF-8
LC_ADDRESS DEFAULT=ru_RU.UTF-8
LC_TELEPHONE DEFAULT=ru_RU.UTF-8
LC_MEASUREMENT DEFAULT=ru_RU.UTF-8
LC_IDENTIFICATION DEFAULT=ru_RU.UTF-8
PAPERSIZE DEFAULT=a4

In case of home directory encryption this directory is not available for the system before login - user must enter its password to decrypt this directory. The similar problem with other config files, for example with SSH as described here in Caveats section.

The solution is to put .pam_environment config file in home directory in unmounted state:

  • Need to create additional temporary user.
  • Reboot the system (to unmount home directory for the current user)
  • Login by temporary user and put .pam_environment language config file to home directory for needed user.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like