I 'm a new Apple OS X Mabbook user. I am getting an error which read as follows when I connect to any remote Linux/Unix/BSD server or machine through OS X ssh Terminal app:
ssh user@server1.cyberciti.biz
Last login: Wed Mar 26 08:45:36 2014 from 1.2.3.4
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
How do I fix this error?
Difficulty | Easy(rss) |
Root privileges | No |
Requirements | None |
Estimated completion time | 2m |
This warning or error is part of both OpenSSH server and OS X ssh terminal client issue. It can be fixed using various methods.
Understanding LC_* environment variables
Type the following command on remote server to display of all locales supported by Glibc: $ locale -a
Next, type the following command to display settings on your local system (OSX/Unix/Linux based desktop):
printenv echo "$LC_CTYPE"
Sample outputs:
UTF-8
The above commands display the country and language names, the character encoding used by the locale. Your local ssh client is sending your LC_* environment variables to remote sshd server. In other words, SSH will try to set every LC_* variable you have set on your local OSX system on the remove server too. Here is an example of such problem:
Fig 01: warning setlocale lc_ctype cannot change locale (utf-8)
Fixing the LC_CTYPE: cannot change locale (UTF-8) error on Linux/OS X
This can be fixed as follows.
Method #1: If you are using the Terminal app on OS X
If you are using the 'Terminal' app then click on Terminal > Preferences > Select Terminal type such as Basic (default) > Advanced tab
Make sure that the 'Set locale environment variables on startup' is unchecked as follows:
Fig.02: Fixing OS X terminal by unsetting ''Set locale environment variables on startup' check box
You must close all ssh session and relaunch Terminal app.
Method #2: Preventing OpenSSH Client from sending the LC_* variables on OS X / Linux / Unix desktop
Edit /etc/ssh/ssh_config or /etc/ssh_config file, enter: $ sudo vi ~/.ssh/config
Remove or comment out as follows:
#SendEnv LANG LC_*
Save and close the file.
Option #3: Install required locale on the remote server
Finally, you can fix this problem either installing the desired locale using the localedef command, or consider choosing a different locale in locale/remote system: # localedef -i en_US -f UTF-8 en_US.UTF-8
相关推荐
在Linux系统中,"telnet不能用,提示:-bash: telnet: command not found"这一问题通常是由于系统中没有预装telnet客户端或者其路径未被添加到环境变量PATH中导致的。telnet是一个远程登录协议,允许用户通过网络在...
linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案 今天在安装程序时,发现有一个插件未安装,我就随手敲了一个命令,看都没看 yum remove yum 然后就杯具了… [root@localhost ~]#...
以上所述是小编给大家介绍的解决-BASH: /HOME/JAVA/JDK1.8.0_221/BIN/JAVA: 权限不够问题,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对软件开发网网站的支持! ...
这个压缩包"jdk-8u131-linux-x64.tar.gz"包含了适用于64位Linux系统的JDK版本。以下是详细的操作步骤和相关知识点: 1. **下载与解压**: - 首先,你需要将`jdk-8u131-linux-x64.tar.gz`文件下载到你的Linux机器上...
以上就是小编为大家带来的解决ssh远程登陆linux显示-bash-4.1$的问题全部内容了,希望大家多多支持软件开发网~ 您可能感兴趣的文章:浅谈linux中shell变量$#,$@,$0,$1,$2的含义解释php $_SERVER windows系统与linux...
官方离线安装包,亲测可用
LC_CTYPE=es_ES.UTF-8 LC_NUMERIC=es_ES.UTF-8 LC_TIME=es_ES.UTF-8 LC_COLLATE=es_ES.UTF-8 LC_MONETARY=es_ES.UTF-8 LC_MESSAGES=es_ES.UTF-8 LC_PAPER=es_ES.UTF-8 LC_NAME=es_ES.UTF-8 LC_ADDRESS=es_ES.UTF-8 ...
git-bash.exe
-bash: /usr/local/jdk/jdk1.8.0_181/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 安装完后 java -version 查看版本出现: 原因是:没有那个文件或目录,找了很久发现需要...
-bash: mysqldump: command not found问题解决
如果没有,可以编辑`~/.bash_profile`或`~/.zshrc`(取决于你的Shell),添加以下行: ```bash export PATH="/usr/local/bin:$PATH" ``` 然后,重新加载配置文件: ```bash source ~/.bash_profile 或 source ~/....
RedHat5 X86:bash-3.2-33.el5_11.4.i386.rpm RedHat5 X86_64:bash-3.2-33.el5_11.4.x86_64.rpm bash-debuginfo-3.2-33.el5_11.4.x86_64.rpm RedHat6 X86:bash-4.1.2-15.el6_5.2.i686.rpm RedHat6 X86_64:bash-4.1.2...
LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_...
SUPPORTED="zh_CN.UTF-8:zh_CN:zh en_US.UTF-8:en_US:en" ``` 这样,在登录系统时,用户可以选择系统显示的语言。 ### 3. 使用环境变量 LC_ALL 和 LANGUAGE 除了修改配置文件之外,还可以通过设置环境变量来临时...
ggcom-bash-utils GotGet Common-Bash-实用程序 Install: mkdir -pv ~/ggcom/ git clone https://github.com/LTGIV/ggcom-bash-library.git ~/ggcom/ggcom-bash-library/ git clone ...
zh_TW.UTF-8 但是中文语言包没安装或没启用,就会出现乱码 输入LANG=en_US设置显示为英文,此命令即时生效,但不能永久生效,永久生效看下面。 此时,再次输入命令就可以看到英文报错信息了 如果一定需要中文提示,...
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" ...
### Raspberry Pi OS Lite (64-bit) 安装 Discuz! 的详细步骤 #### 一、准备工作 在开始安装Discuz!之前,首先确保你已经准备好了必要的软硬件环境: 1. **镜像下载**: - 访问官方链接:...
离线安装包,测试可用