Mac terminal ssh 到 Linux 時,出現 cannot change locale (UTF-8) 訊息

每回從 Mac terminal 登入到 CentOS,一登入就會看到以下的訊息
雖然沒什麼問題,就覺得有點不完美

testuser@localhost ~ $ ssh_linux
Last login: Wed Dec 27 23:22:50 2016 from 10.28.28.39
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

tl;dr

登入 CentOS 後,改個檔案再重登即可

vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8

詳細的發生原因參考以下幾篇
[Mac] SSH 到 Linux 機器時,出現 cannot change locale (UTF-8) 訊息
解決遠端 SSH 連線主機時文字編碼設定 locale 錯亂問題


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Exit mobile version