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
相关推荐
NULL 博文链接:https://javatea.iteye.com/blog/2360941
解决Centos6.7:-bash: ./DrClientLinux: /lib/ld-linux.so.2: bad ELF 的所有rpm包
linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案 今天在安装程序时,发现有一个插件未安装,我就随手敲了一个命令,看都没看 yum remove yum 然后就杯具了… [root@localhost ~]#...
/bin/bash #查看每个节点运行情况 for((host=101;host<108;host++));do echo -----------hadoop$host------------- ssh hadoop$host jps done 这里默认服务器节点的名字是hadoop101-hadoop107 默认已经配置了...
以上就是小编为大家带来的解决ssh远程登陆linux显示-bash-4.1$的问题全部内容了,希望大家多多支持软件开发网~ 您可能感兴趣的文章:浅谈linux中shell变量$#,$@,$0,$1,$2的含义解释php $_SERVER windows系统与linux...
官方离线安装包,亲测可用
以上所述是小编给大家介绍的解决-BASH: /HOME/JAVA/JDK1.8.0_221/BIN/JAVA: 权限不够问题,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对软件开发网网站的支持! ...
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 ...
60-Linux-Bash-Terminal-Keyboard-Shortcuts-1.pdf
git-bash.exe
-bash: mysqldump: command not found问题解决
linux下提示bash-command not found.docx
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...
-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 查看版本出现: 原因是:没有那个文件或目录,找了很久发现需要...
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 ...
离线安装包,测试可用
libguestfs-bash-completion-1.40.2-28.module_el8.5.0+821+97472045.noarch(1).rpm官方离线安装包,亲测可用
前几天重装了mysql,装好之后navicat一直正常可以对mysql进行操作,但是今天要使用命令行进行操作时遇到-bash: mysql: command not found的问题。 总结一下解决办法: 这个问题的出现是两个原因 1 .bash_profile中...
NULL 博文链接:https://myeyeofjava.iteye.com/blog/1898291