I have a Shell script on a server. The script is run by a particular user, not root.
The script has the following:
export DISPLAY=:8
Xorg $DISPLAY
But there is an error:
Fatal server error: PAM authentication failed, cannot start X server. Perhaps you do not have console ownership?
Can anyone guide me on how to fix this? I've been Googling but there are numerous different answers so I need a bit of guidance.
Thanks for your time.
Edit: I have found this (enter link description here) which suggests changing the /etc/pam.d/xserver file but I don't really know if that's the right thing to do?