Edit /etc/locale.conf and change it to LANG="en_US.UTF-8", after restarting the server, enter the system, it still displays Chinese
# locale -a | grep en_US
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8 //English utf8 locale is supported
root@BJ-CentOS7 ~ # echo $LANG
zh_CN.UTF-8//The locale in effect is Chinese utf8
root@BJ-CentOS7 ~ # locale
LANG=zh_CN.UTF-8//The locale in effect is Chinese utf8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
root@BJ-CentOS7 ~ # grep LANG /etc/locale.conf
LANG="en_US.UTF-8"
root@BJ-CentOS7 ~ # grep LANG /etc/profile
root@BJ-CentOS7 ~ # grep LANG ~/.bashrc
It turns out that the SendEnv and AcceptEnv parameters are configured by default in the server as a springboard and the target server to be connected, and the $LANG variable is configured in both the client and the remote host, which causes the environment variables specified in the client environment to take effect in the remote session Up
In the client ssh_config configuration file: The SendEnv parameter is used to define which environment variables are sent to the remote session
In the remote host sshd_config configuration file: The AcceptEnv parameter is used to define which matched environment variables are received
root@BJ-CentOS7 ~ # grep AcceptEnv /etc/ssh/sshd_config
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
root@BJ-CentOS7 ~ #
root@BJ-CentOS7 ~ # grep SendEnv /etc/ssh/ssh_config
SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE
SendEnv XMODIFIERS
Reference documents:
https://www.cnblogs.com/52linux/archive/2012/03/24/2415470.html