How can I configure `anybody` to run X in a one-liner?

14,839

The solution I found was to run the following:

sudo sed -i \
    's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config

Note, that in your situation, the console may be root or another, based on your particular initial configuration*

Share:
14,839
ljs.dev
Author by

ljs.dev

Updated on September 18, 2022

Comments

  • ljs.dev
    ljs.dev over 1 year

    The common solution posted is to run sudo dpkg-reconfigure x11-common which gives a graphical prompt, however, I'm wanting to use this non-interactively.

    Scenario is that I'm SSH'd into a machine as root (during Vagrant provisioning) and need to run startx once as a regular user to generate some config files before proceeding to subsequent steps.

    I believe the reason I cannot simply su otheruser startx is due to Xauthority/me being connected via SSH as another user...

  • Sebastian
    Sebastian over 9 years
    convincing X to drop root privileges is a rather new feature (xorg 1.16.0 iirc). Details are found in man Xorg.wrap.
  • imsodin
    imsodin about 8 years
    On debian the configuration file "Xwrapper.config" may be present, while the package xserver-xorg-legacy is not installed. In this case it has no effect, so the problems persist after changing the configuration.