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

Bagus Trihatmaja picture Bagus Trihatmaja · Dec 27, 2015 · Viewed 16.5k times · Source

Every time I log in from SSH, I get:

Only console users are allowed to run the X server

I also get this if I make a new tmux pane, which I can handle by putting:

test -z ${TMUX} && startx

in my .zprofile

I assume I get the message because I run startx. How can I make it not to run startx if I log in from ssh?

Answer

Bagus Trihatmaja picture Bagus Trihatmaja · Dec 28, 2015

So, I found a solution for this, that is by login automatically right after booting by using xlogin and dbus.

Here is a wiki of how to do that:

Automatic login into xorg without display manager