Wednesday, April 27, 2022

[SOLVED] How not to pass the locale through an ssh connection command

Issue

I have some aliases for ssh, example:

alias buildWork="ssh work '~/build_app'"

The problem is that the ssh command passes some variables like $LC_CTYPE that causes some errors.

How to prevent that and use the server configurations ?


Solution

It sounds like your SSH client is configured to forward the locale settings. You can prevent this by altering your configuration (the global file is typically /etc/ssh/ssh_config):

# comment out / remove the following line
SendEnv LANG LC_*

Alternatively you can change the configuration of the server, by editing /etc/ssh/sshd_config on the remote machine (note the d in sshd_config):

# comment out / remove the following line
AcceptEnv LANG LC_*


Answered By - Tom Fenech
Answer Checked By - Dawn Plyler (WPSolving Volunteer)