fix mac locale

客户端解决方案

Mac使用错误的LC_CTYPE,会导致ssh到ubuntu-14.04后,无法输入中文。

$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

################### unset terminal locale env ####################

$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

服务端解决方案

$ lsb_release -r
Release: 14.04

$ sudo vim /etc/ssh/sshd_config
# Disallow client to pass locale environment variables
# AcceptEnv LANG LC_*

$ sudo systemctl reload ssh