Disable locale passing on ssh connection

You might have seen these super annoying error messages on a new Linux system:

You cans see the current locale by typing locale.

You should see something like this en_US.UTF-8 because that’s the most used locale and usually the preferred way to use Linux servers.

But if you don’t then this is most often because you have logged in with ssh and your ssh client is passing the locale of your own system into the server. There are two ways to prevent this.

Easiest is to disabled the passing from your own system (the one where you are connecting from):

The other way is to prevent the passing of the locale on your ssh server (the one you are connecting to):

Now just relog to your server and type locale again.