首页 > 技术文章 > ssh登录locale报错:cannot change locale (zh_CN.UTF-8): No such file or directory

sky-cheng 2019-04-23 11:51 原文

一、登录ssh报错:

Last login: Tue Apr 23 03:42:01 2019 from 172.28.146.109
-bash: warning: setlocale: LC_ALL: cannot change locale (en_CN.UTF-8): No such file or directory
-bash: warning: setlocale: LC_ALL: cannot change locale (en_CN.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8): No such file or directory
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)

二、编辑/etc/profile文件

vim /etc/profile

末尾加上:

export LC_ALL=C

生效

source /etc/profile

重新登录ssh即可。

推荐阅读