unset LC_* previous to ssh

0

In my ~/.bashrc I have environment variables definition similar to

export LC_CTYPE="es_ES.UTF-8"

when I use a ssh connection some of this variables have problems in the remote computer

man: can't set the locale; make sure $LC_* and $LANG are correct

how I can unset some variables when I start a ssh connection and restore when I close the connection.

juanpablo

Posted 2012-10-18T15:24:42.247

Reputation: 5 216

Answers

1

ssh doesn't copy your local environment to the remote machine. See the ENVIRONMENT section of the ssh man page for details. In short, there is a small list of variables that are set in the remote session, and you can put additional variables in ~/.ssh/environment. Note that the ability to set the environment on the remote end from the local machine needs to be enabled in the remote sshd process via the PermitUserEnvironment configuration option.

Alternatively, you need to set the values you need on the remote machine in your .bashrc file on the remote machine.

chepner

Posted 2012-10-18T15:24:42.247

Reputation: 5 645