* [gentoo-user] LC_ALL etc. not set when sshing into TMux
@ 2016-06-30 19:11 Bertram Scharpf
2016-06-30 19:43 ` [gentoo-user] " Ian Zimmerman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bertram Scharpf @ 2016-06-30 19:11 UTC (permalink / raw
To: gentoo-user
Hi,
after upgrading to an admittedly masked TMux 2.2, when I want
to ssh into it I get the following message:
$ ssh -t gentoohost tmux attach
tmux: need UTF-8 locale (LC_CTYPE) but have ANSI_X3.4-1968
Connection to gentoohost.mydomain.local closed.
To find out what locale is set I wrote this little C
program:
int main(int argc, char **argv, char **env)
{
char **e;
for (e = env; *e != 0; e++)
printf( "%s\n", *e);
return 0;
}
Then, after compiling,
$ ssh -t chris ./showenv | grep '^LC\|^LANG'
this yields the empty result indeed. Therefore I guess
TMux's behaviour is correct and the mistake is done by some
ssh or login or whatsoever.
The top (grandparent) sshd process has LC_ALL and LANG set
with utf8, but the childs and grandchilds environments are
empty.
Probably I could get rid of the error message by SSH's
SendEnv feature, but this would be just a workaround.
What is your suggestion to solve this?
Thanks in advance,
Bertram
--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gentoo-user] Re: LC_ALL etc. not set when sshing into TMux
2016-06-30 19:11 [gentoo-user] LC_ALL etc. not set when sshing into TMux Bertram Scharpf
@ 2016-06-30 19:43 ` Ian Zimmerman
2016-06-30 21:41 ` [gentoo-user] " Neil Bothwick
2016-08-12 10:31 ` [gentoo-user] Re: [SOLVED] " Bertram Scharpf
2 siblings, 0 replies; 4+ messages in thread
From: Ian Zimmerman @ 2016-06-30 19:43 UTC (permalink / raw
To: gentoo-user
On 2016-06-30 21:11 +0200, Bertram Scharpf wrote:
> The top (grandparent) sshd process has LC_ALL and LANG set with utf8,
> but the childs and grandchilds environments are empty.
Isn't this a feature?
Looks to me like sshd is properly sanitizing the environment for the
client, isolating it from the details of the host system which are
probably irrelevant.
Let's say tmux needs to spit out an error message. Should it be in the
LANG of the server, or the LANG of the user who has logged in remotely?
> Probably I could get rid of the error message by SSH's
> SendEnv feature, but this would be just a workaround.
This seems to be the proper solution to me.
--
Please *no* private copies of mailing list or newsgroup messages.
Why does the arrow on Hillary signs point to the right?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] LC_ALL etc. not set when sshing into TMux
2016-06-30 19:11 [gentoo-user] LC_ALL etc. not set when sshing into TMux Bertram Scharpf
2016-06-30 19:43 ` [gentoo-user] " Ian Zimmerman
@ 2016-06-30 21:41 ` Neil Bothwick
2016-08-12 10:31 ` [gentoo-user] Re: [SOLVED] " Bertram Scharpf
2 siblings, 0 replies; 4+ messages in thread
From: Neil Bothwick @ 2016-06-30 21:41 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 809 bytes --]
On Thu, 30 Jun 2016 21:11:14 +0200, Bertram Scharpf wrote:
> after upgrading to an admittedly masked TMux 2.2,
2.2 isn't masked, although it is keyworded. These are two very different
things.
> when I want
> to ssh into it I get the following message:
>
> $ ssh -t gentoohost tmux attach
> tmux: need UTF-8 locale (LC_CTYPE) but have ANSI_X3.4-1968
I got hit by this a couple of weeks ago.
> Probably I could get rid of the error message by SSH's
> SendEnv feature, but this would be just a workaround.
That is exactly the solution that worked for me
SendEnv LANG LC_*
in ssh_config
--
Neil Bothwick
Q. How many radical feminists does it take to change a light bulb?
A. Two - one to change the bulb and one to write a book about the passive
role of the socket.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gentoo-user] Re: [SOLVED] LC_ALL etc. not set when sshing into TMux
2016-06-30 19:11 [gentoo-user] LC_ALL etc. not set when sshing into TMux Bertram Scharpf
2016-06-30 19:43 ` [gentoo-user] " Ian Zimmerman
2016-06-30 21:41 ` [gentoo-user] " Neil Bothwick
@ 2016-08-12 10:31 ` Bertram Scharpf
2 siblings, 0 replies; 4+ messages in thread
From: Bertram Scharpf @ 2016-08-12 10:31 UTC (permalink / raw
To: gentoo-user
On Thursday, 30. Jun 2016, 21:11:14 +0200, Bertram Scharpf wrote:
> [...] TMux [...], when I want
> to ssh into it I get the following message:
>
> $ ssh -t gentoohost tmux attach
> tmux: need UTF-8 locale (LC_CTYPE) but have ANSI_X3.4-1968
> Connection to gentoohost.mydomain.local closed.
>
> To find out what locale is set I wrote this little C
> program:
>
> int main(int argc, char **argv, char **env)
> {
> char **e;
> for (e = env; *e != 0; e++)
> printf( "%s\n", *e);
> return 0;
> }
>
> Then, after compiling,
>
> $ ssh -t gentoohost ./showenv | grep '^LC\|^LANG'
>
> this yields the empty result indeed. Therefore I guess
> TMux's behaviour is correct and the mistake is done by some
> ssh or login or whatsoever.
>
> The top (grandparent) sshd process has LC_ALL and LANG set
> with utf8, but the childs and grandchilds environments are
> empty.
I got hit by this yet another time when I tried to find out
why TMux's "mode-keys" option doesn't get set to "vi". This
depends on the EDITOR environment variable that is left
empty as well.
The solution is to set the environment variables by
"pam_env" which is called in "/etc/pam.d/sshd".
---- /etc/pam.d/included_by_ssh---------------------------------
session required pam_env.so
----------------------------------------------------------------
Append the following lines to the pam_env configuration:
---- /etc/security/pam_env.conf --------------------------------
PAGER DEFAULT=less
EDITOR DEFAULT=vim
LANG DEFAULT=de_DE.UTF-8
LC_COLLATE DEFAULT=C
----------------------------------------------------------------
Bertram
--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-12 10:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-30 19:11 [gentoo-user] LC_ALL etc. not set when sshing into TMux Bertram Scharpf
2016-06-30 19:43 ` [gentoo-user] " Ian Zimmerman
2016-06-30 21:41 ` [gentoo-user] " Neil Bothwick
2016-08-12 10:31 ` [gentoo-user] Re: [SOLVED] " Bertram Scharpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox