Rasmus Einarsson

27 January 2015

Don't send your locale with SSH

tldr:

Ensure that SSH will not force your locale settings on the remote machine by editing the SSH config file (on my machine /etc/ssh/ssh_config). Make sure that the option SendEnv LANG LC_* is not present, or commented out, like so:

#   SendEnv LANG LC_*

What’s the point?

I had some problems installing a PostgreSQL (postgresql-9.3) database on a VirtualBox (using Vagrant and Ansible, but that should not matter). After installation, Perl was complaining things like

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
...

The confusion was caused by my machine sending its own locale in the SSH session to the virtual machine, confusing the installation procedure which then failed. I don’t see the point in sending your own locale to a remote machine as a standard setting, so I now choose to change the default behavior as described above.