我正在查看http://taint.org/wk/RemoteLoginAutoScreen来设置我的服务器,以便在我通过 SSH 登录时自动启动屏幕会话。
我已将以下内容添加到我的 .bashrc 中:
# Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen
# if we're coming from a remote SSH connection, in an interactive session
# then automatically put us into a screen(1) session. Only try once
# -- if $STARTED_SCREEN is set, don't try it again, to avoid looping
# if screen fails for some reason.
if [ "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" != x ]
then
STARTED_SCREEN=1 ; export STARTED_SCREEN
[ -d $HOME/lib/screen-logs …Run Code Online (Sandbox Code Playgroud)