0

I'm running commands on a remote host via ssh where i'd like to have locale vars set. I do not care about the full profile scripts from a true interactive shell, just the locale vars.

The minimum test is to have ssh remotehost locale to output something other than "POSIX" or empty values.

I already tried to set SendEnv LANG on my ssh config. But that did not work.

The only workaround that does work is to manually export the locale to a hardcoded value each time i run a command. e.g. ssh vma LANG=en_US.utf-8 locale or more realistically ssh vma export LANG=en_US.utf-8; series; of; commands;

default shell is bash but i'm guessing a possible solution would be on the ssh side alone?

gcb
  • 344
  • 1
  • 4
  • 18
  • 3
    `SendEnv` is the correct approach. Is `AcceptEnv` on the sshd configured to accept your vars? – Gerald Schneider Mar 30 '20 at 12:43
  • sigh. no. I tested with TERM to see if it was needed, but TERM apparently is whitelisted regardless. Now that i added `AcceptEnv LANG LC_COLLATE` to my `sshd_config` file it works fine! – gcb Mar 30 '20 at 18:39

0 Answers0