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输入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 ...
### Raspberry Pi OS Lite (64-bit) 安装 Discuz! 的详细步骤 #### 一、准备工作 在开始安装Discuz!之前,首先确保你已经准备好了必要的软硬件环境: 1. **镜像下载**: - 访问官方链接:...
离线安装包,测试可用
```bash ls ``` - **显示所有文件**: - **参数**: `-a` - **功能**: 显示当前目录下所有的文件和子目录,包括隐藏文件(以`.`开头)。 - **命令示例**: ```bash ls -a ``` - **只列出目录**: - **参数*...
`artisan-bash-completion-plugin`是一个增强Artisan命令体验的插件,它允许在Bash shell环境中自动补全Artisan命令,从而提高开发效率。 首先,了解Bash shell:Bash是Unix和Linux系统中最常用的命令行解释器,它...