MacOS終端狀態(tài)下镇防,使用ssh遠(yuǎn)程連接服務(wù)器時(shí)迈喉,服務(wù)端會(huì)發(fā)出如下警告:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
終端內(nèi)有關(guān)中文的輸出則都會(huì)無(wú)法正常顯示颜屠。
解決方案
修改客戶端SSH配置文件:
(OS High Sierra / Linux) sudo vi /etc/ssh/ssh_config
在文件中注釋(#)下面配置:
SendEnv LANG LC_*
重新打開(kāi)終端進(jìn)行ssh連接粮坞,問(wèn)題解決。
References
https://www.yangrunwei.com/a/74.html
https://www.cyberciti.biz/faq/os-x-terminal-bash-warning-setlocale-lc_ctype-cannot-change-locale/