Admin... by accident!

You may have chosen to be an admin. I didn't!

  • Home
  • FreeBSD
  • GNU/Linux
  • Security
  • Network
  • Virtualization
  • Politics
  • Github
  • Donate
  • Me

How to set the locale in FreeBSD

April 25, 2017 by Albert Valbuena

The locale is the character set that will be used. And it is very important to match the keyboard you are using. Mind this also matters if you are transferring data to other systems. Different standards as the ASCII, UTF’s and the ISO’s, to name a few, have been put in place through the years to flat the terrain and adapt the systems to different languages, keyboards, etc.

If you find the articles in Adminbyaccident.com useful to you, please consider making a donation.

Setting the locale  correctly, systemwide or per user basis, is very important. Even if you have selected the right keyboard setting at install time you may find yourself typing gibberish characters when you press certain keys. Russians, Latinos, Germans, Asians and others have learned this the hard way which is a big shame, still, in the computing era.
Depending on your environment you will need to set it systemwide or per user basis. We will set it systemwide and we’ll also set it for our user case.

User centric configuration.

In the user’s home folder type “ls -a” so you will see all the files, even the hidden ones. Now that you know what’s hidden, just edit the file .login.conf as follows:

me:\
:charset=UTF-8:\
:lang=xx_XX.UTF-8:

Obviously don’t type x letters but your chosen UTF-8 set. If you are spanish you may type:

:charset=UTF-8:\
:lang=es_ES.UTF-8:

For other languages just head to the FreeBSD handbook online at https://www.freebsd.org and play around with the settings for you. Be patient and please pray for the developers to add this support by default once you are setting the keyboard during the installation.

Now log out and get back in for the changes to take effect. Enjoy your now working keyboard.

System wide centric configuration.

You have to edit and add into the /etc/login.conf file and append at the bottom of the :default column the following bits:

:umask=022:
:charset=UTF-8:\
:lang=xx_XX.UTF-8:

Once /etc/login.conf file has been modified the login class database has to be rebuild. We’ll do so by:

sudo cap_mkdb /etc/login.conf

You can set both configuration settings, just locally or system wide, in your local machine simultaneously. I pray you set this one out and you do it right. I beg you do. It is astonishing and very embarrassing to see that still in this era very important companies and institutions still haven’t configured some of their public facing systems with the right locale. If this very site you are reading has something wrong it will only affect a few viewers and I will be the only responsible for that. Financial institutions, governments and big retail companies are still failing to implement this. The locale settings are so basic they matter.

This same setup can be built in DigitalOcean. Use this link to get 100 $ credit at DOcean and support Adminbyaccident.com hosting costs.

Filed Under: How To's

Recent Posts

  • How to install ModSecurity 3 on FreeBSD
  • How to replace a disk on a ZFS mirror pool
  • How to install Webmin on FreeBSD 12
  • How to patch OpenSSH in FreeBSD 12.2
  • The CentOS party is over, isn’t it?
  • Donation Time 2020
  • How to configure TLS 1.2 on UNIX or GNU/Linux
  • How to install the Clamav antivirus on CentOS 8
  • 100 articles mark at Adminbyaccident.com
  • How to analyze suspicious email
  • How to work with Nessus scan results
  • How to install Ansible on FreeBSD
  • How to secure the ELK stack on CentOS 8
  • How to mirror disks on FreeBSD’s ZFS
  • Nmap cheatsheet
  • Nessus vulnerability scanner
  • How to install the ELK stack on CentOS 8
  • How to install OSSEC agents on Windows
  • Exploiting CVE-2019-0708 Remote Desktop Protocol on Windows
  • Microsoft’s Patch Tuesday – April 2020

Archives

  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • September 2018
  • June 2018
  • May 2018
  • April 2018
  • February 2018
  • January 2018
  • November 2017
  • April 2017

Copyright © 2021 · Magazine Pro Theme on Genesis Framework · WordPress · Log in