SSH 登录显示只有控制台用户可以 运行 X 服务器

SSH login shows Only console users are allowed to run the X server

每次我从 SSH 登录时,我得到:

Only console users are allowed to run the X server

如果我制作一个新的 tmux 窗格,我也会得到这个,我可以通过放置来处理:

test -z ${TMUX} && startx

在我的 .zprofile

我想我收到消息是因为我 运行 startx。 如果我从 ssh 登录,我怎样才能不 运行 startx

所以,我找到了一个解决方案,即在启动后使用 xlogindbus 自动登录。

这是一个关于如何做到这一点的 wiki:

Automatic login into xorg without display manager