This article was published on May 12th 2014 and takes about 1 minute to read.
Use it with caution — it is probably still valid, but it has not been updated for over a year.
When you log in to your server via SSH, you want the commands' output to be in English. Other languages can cause problems, mainly with poorly written scripts which rely on English output when parsing system commands.
If your server outputs error messages and results of system commands in a language other than English, there are two things you can do about it:
As root, edit the file
/etc/sysconfig/i18n (on CentOS/RedHat machines) or
/etc/default/locale (on Ubuntu/Debian machines) to use English as the default language. Look for the line that starts with
and change it to use the right locale:
Especially Mac OS X likes to send local environment variables to your server via SSH. If your server accepts these variables, you end up with command output in your own language which is polite, but not what you want. To put an end to it, open the SSH configuration file (
/etc/ssh/sshd_config) as root, find the line which reads
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
and remove it or comment it out (put a
# in front).
After making those changes, restart the SSH daemon to make the changes take effect: