ssh连接ubuntu时中文乱码解决
Posted zhangmingcsdn
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ssh连接ubuntu时中文乱码解决相关的知识,希望对你有一定的参考价值。
ssh连接ubuntu时中文乱码解决
方法:
1,运行命令
vim /etc/default/locale
2,修改文件内容为
# File generated by update-locale
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:en_US:en"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_IDENTIFICATION="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"
3,运行命令,使配置生效
source /etc/default/locale
4,重连ssh或重启产生日志的应用程序(比如java程序)
注意:如果运行source命令后有以下提示,就注释掉 LC_NUMERIC、LC_TIME后保存重新运行source命令
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (zh_CN.UTF-8)
-bash: warning: setlocale: LC_TIME: cannot change locale (zh_CN.UTF-8)
注释后的内容:
# File generated by update-locale
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:en_US:en"
#LC_NUMERIC="zh_CN.UTF-8"
#LC_TIME="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_IDENTIFICATION="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"
以上是关于ssh连接ubuntu时中文乱码解决的主要内容,如果未能解决你的问题,请参考以下文章