如何不通过 ssh 连接命令传递语言环境 [英] How not to pass the locale through an ssh connection command
问题描述
我有一些 ssh 的别名,例如:
I have some aliases for ssh, example:
alias buildWork="ssh work '~/build_app'"
问题是 ssh
命令传递了一些变量,例如 $LC_CTYPE
会导致一些错误.
The problem is that the ssh
command passes some variables like $LC_CTYPE
that causes some errors.
如何防止并使用服务器配置?
How to prevent that and use the server configurations ?
推荐答案
听起来您的 SSH 客户端已配置为转发区域设置.您可以通过更改配置来防止这种情况(全局文件通常是 /etc/ssh/ssh_config
):
It sounds like your SSH client is configured to forward the locale settings. You can prevent this by altering your configuration (the global file is typically /etc/ssh/ssh_config
):
# comment out / remove the following line
SendEnv LANG LC_*
或者,您可以通过在远程机器上编辑 /etc/ssh/sshd_config
来更改服务器的配置(注意 sshd_config 中的 d代码>):
Alternatively you can change the configuration of the server, by editing /etc/ssh/sshd_config
on the remote machine (note the d in sshd_config
):
# comment out / remove the following line
AcceptEnv LANG LC_*
这篇关于如何不通过 ssh 连接命令传递语言环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!