Linux login shell 信息展示类(neofetch、motd 等 banner 类提示信息展示)导致的 rsync 服务不可用问题注意事项

Linux login shell 信息展示类(neofetch、motd 等 banner 类提示信息展示)导致的 rsync 服务不可用问题注意事项

终端报错信息(以 Debian 11 系统为例):protocol version mismatch — is your shell clean?
系统环境
  • OS: Debian GNU/Linux 11 (bullseye) x86_64
  • Host: KVM RHEL 7.6.0 PC (i440FX + PIIX, 1996)
  • Kernel: 5.10.0-22-amd64
问题描述
  • 【问题】:导致 rsync 服务同步失败,报错信息: "protocol version mismatch — is your shell clean?"

  • 【原因】:rsync 等工具非常依赖于 shell 执行时没有任何输出。

  • 【建议】:不建议在.bashrc 中输出 neofetch、banner 类和 motd 类提示信息,在~/.profile 中 source ~/.bashrc 可以避免此问题,但需注意.profile循环引用执行问题。

Read more