Preventing Open SSH from sending the LC_* variables
The fix is very easy. On your local system open your ssh_config file as root (usually in /etc/ssh_config or /etc/sshd/ssh_config) and comment this line:
SendEnv LANG LC_*
That’s it! From now on you will no longer get the annoying Bash error. Alternatively you can also set the locale setting of your locale system to something that matches your remote system, but this is the foolproof way that will always work, regardless of the locale config of your local and remote system.