Artix Linux Forum

Artix Linux => System => Topic started by: fehigax145 on 09 November 2020, 12:59:18

Title: [SOLVED] Xorg starts from root user
Post by: fehigax145 on 09 November 2020, 12:59:18
Hey guys! I'm using xorg-xinit. startx runs xorg from root user. I have elogind-runit installed. Tried it on Arch virtual machine and xorg runs from regular user. How do I fix this security vulnerability?
Title: Re: Xorg starts from root user
Post by: alium on 09 November 2020, 13:37:30
You can try read wiki https://wiki.archlinux.org/index.php/xorg#Rootless_Xorg
Title: Re: Xorg starts from root user
Post by: fehigax145 on 09 November 2020, 13:44:06
You can try read wiki https://wiki.archlinux.org/index.php/xorg#Rootless_Xorg
Don't you think that xorg should start from regular user by default?
Title: Re: Xorg starts from root user
Post by: Dudemanguy on 09 November 2020, 14:47:09
Don't you think that xorg should start from regular user by default?

It does if you have elogind enabled and running. Make sure you enabled elogind at boot time.
Title: Re: Xorg starts from root user
Post by: fehigax145 on 09 November 2020, 14:54:43
It does if you have elogind enabled and running. Make sure you enabled elogind at boot time.
Is there a boot runlevel in runit? By default elogind is in"default" runlevel.
Title: Re: Xorg starts from root user
Post by: Dudemanguy on 09 November 2020, 15:21:27
Is there a boot runlevel in runit? By default elogind is in"default" runlevel.

That's the one for runit. Did you enable it there?
Title: Re: Xorg starts from root user
Post by: fehigax145 on 09 November 2020, 15:26:59
That's the one for runit. Did you enable it there?
Yeah, it was already enabled.
Title: Re: Xorg starts from root user
Post by: nous on 09 November 2020, 16:35:46
Is xorg-xwrapper installed in your system?
Title: Re: Xorg starts from root user
Post by: fehigax145 on 09 November 2020, 17:05:30
Is xorg-xwrapper installed in your system?
No, it isn't. Should I add needs_root_rights = no to it's config file?
Title: Re: Xorg starts from root user
Post by: nous on 14 November 2020, 15:13:37
If you set up from base ISO, then your either missed something or added something; the DE ISOs start X rootless. If asked about xorg-xwrapper because it might be one reason your X is root-started. It doesn't hurt to try adding needs_root_rights=no and see how it goes.
Title: Re: Xorg starts from root user
Post by: fehigax145 on 14 November 2020, 16:26:27
If you set up from base ISO, then your either missed something or added something; the DE ISOs start X rootless. If asked about xorg-xwrapper because it might be one reason your X is root-started. It doesn't hurt to try adding needs_root_rights=no and see how it goes.
I set up my system from the base ISO. I haven't done any configuration to neither nvidia driver or xorg. I found out that by default xorg starts by root if nvidia drivers are used. But if I add  needs_root_rights = no  to /etc/X11/Xwrapper.config everything goes fine and xorg starts from regular user.
Title: Re: Xorg starts from root user
Post by: nous on 14 November 2020, 19:07:24
Good to know it works both ways.