我的 zsh shell 自动启动 byobu。目前,有问题的主机的 1m loadavg 为 300(本地 ssh host time uptime 返回时间为 50 秒,远程则为 3 秒)。
启动 byobu 需要花费大量时间。我想在不使用 byobu 的情况下启动。我可以传递一些环境变量来取消 byobu 启动吗?
答案1
当然,您可以使用 LC_BYOBU=0 环境变量:
LC_BYOBU=0 ssh user@hostname
或者,您也可以这样做:
ssh -t user@hostname zsh
或者
ssh -t user@hostname bash
全面披露:我是屏风。
答案2
如在以下网址找到的/usr/bin/byobu-launch
:
# 1) Prevent recursion, and multiple sourcing of profiles with the BYOBU_SOURCED_PROFILE environment variable.
# 2) Respect environment variables (LC_BYOBU and BYOBU_DISABLE) passable over SSH to disable
# Byobu launch. This puts that configurability on the SSH client,
# in addition to the server.
# To use over SSH, your /etc/ssh/sshd_config and /etc/ssh/ssh_config
# must pass this variable with AcceptEnv and SendEnv.
# Note that LC_* are passed by default on Debian/Ubuntu, we'll optionally
# support LC_BYOBU=0
# And in your local bashrc:
# $HOME/.bashrc: export LC_BYOBU=0
# or edit your sshd_config, ssh_config, and set:
# $HOME/.bashrc: export BYOBU_DISABLE=1