通过 ssh 访问远程机器时出现命令未找到异常

通过 ssh 访问远程机器时出现命令未找到异常

当我使用 ssh 访问某些远程计算机时,我们有奇怪的行为

所有机器都是rhel 7.2版本

这就是我们得到的

ssh server142
Last login: Thu May 27 09:44:13 2021 from  server_ER




-bash: server: command not found
-bash: stratumweight: command not found
-bash: driftfile: command not found
-bash: $'rtcsync\r': command not found
-bash: makestep: command not found
-bash: bindcmdaddress: command not found
-bash: bindcmdaddress: command not found
-bash: keyfile: command not found
-bash: commandkey: command not found
-bash: $'generatecommandkey\r': command not found
-bash: $'\r': command not found
-bash: $'noclientlog\r': command not found
-bash: logchange: command not found
-bash: $'\r': command not found
-bash: logdir: command not found

所以我们检查了$PATH坏服务器上的 并将其与其他好的服务器进行比较,但两个 $PATH 输出都是相同的输出

例子

echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

我们还比较了bashrc机器之间的好坏,也没有差异

有任何提示可能是什么原因造成这个问题吗?

答案1

某些\r消息中的 强烈暗示文件中存在 Windows 行结尾。

答案2

问题出在文件上/etc/bash_completion.d/chrony.conf

所以我们将此文件移动为

 mv /etc/bash_completion.d/chrony.conf /var/tmp

相关内容