Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[gelöst] Xorg läuft als root
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
kurisu
Apprentice
Apprentice


Joined: 19 Jan 2011
Posts: 177
Location: Munich, Germany

PostPosted: Tue Apr 05, 2022 7:59 am    Post subject: [gelöst] Xorg läuft als root Reply with quote

Hallo zusammen,

ich habe festgestellt, dass entgegen andersartiger Konfiguration Xorg als root läuft:

Code:
~ $ ps -fC X
UID        PID  PPID  C STIME TTY          TIME CMD
root      3978  3936  2 06:39 tty7     00:03:47 /usr/bin/X -nolisten tcp -auth /var/run/sddm/{9855e959-9703-4c9e-bdc9-f851c9d2a2fe} -background none -noreset -displayfd 17 -seat seat0 vt7


Verwendet werden OpenRC und elogind mit SDDM als DM sowie Xfce als DE.

Hier einige relevante Codeblocks:

Code:
~ $ emerge -pv xorg-server

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-base/xorg-server-21.1.3-r1:0/21.1.3::gentoo  USE="elogind udev xorg -debug -minimal (-selinux) -suid -systemd -test -unwind -xcsecurity -xephyr -xnest -xvfb" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB


Code:
~ $ loginctl user-status
christian (1000)
           Since: Tue 2022-04-05 06:39:11 CEST; 3h 2min ago
           State: active
        Sessions: *2
          Linger: no
            Unit: user-1000.slice


Code:
~ $ cat .xinitrc
#!/bin/sh

# Make sure this is before the 'exec' command or it won't be sourced
[ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.xprofile ] && . ~/.xprofile

exec startxfce4


Code:
~ $ cat /var/log/sddm.log
[06:39:08.069] (II) DAEMON: Initializing...
[06:39:08.074] (II) DAEMON: Starting...
[06:39:08.074] (II) DAEMON: Logind interface found
[06:39:08.074] (II) DAEMON: Adding new display on vt 7 ...
[06:39:08.075] (II) DAEMON: Loading theme configuration from ""
[06:39:08.075] (II) DAEMON: Display server starting...
[06:39:08.075] (II) DAEMON: Adding cookie to "/var/run/sddm/{9855e959-9703-4c9e-bdc9-f851c9d2a2fe}"
[06:39:08.078] (II) DAEMON: Running: /usr/bin/X -nolisten tcp -auth /var/run/sddm/{9855e959-9703-4c9e-bdc9-f851c9d2a2fe} -background none -noreset -displayfd 17 -seat seat0 vt7
[06:39:08.599] (II) DAEMON: Setting default cursor
[06:39:08.607] (II) DAEMON: Running display setup script  "/etc/sddm/scripts/Xsetup"
[06:39:08.648] (II) DAEMON: Display server started.
[06:39:08.648] (II) DAEMON: Socket server starting...
[06:39:08.649] (II) DAEMON: Socket server started.
[06:39:08.649] (II) DAEMON: Loading theme configuration from ""
[06:39:08.649] (II) DAEMON: Greeter starting...
[06:39:08.659] (II) HELPER: [PAM] Starting...
[06:39:08.659] (II) HELPER: [PAM] Authenticating...
[06:39:08.659] (II) HELPER: [PAM] returning.
[06:39:08.667] (II) DAEMON: Greeter session started successfully
[06:39:08.726] (II) DAEMON: Message received from greeter: Connect
[06:39:11.217] (II) DAEMON: Message received from greeter: Login
[06:39:11.217] (II) DAEMON: Reading from "/usr/share/xsessions/xfce.desktop"
[06:39:11.218] (II) DAEMON: Reading from "/usr/share/xsessions/xfce.desktop"
[06:39:11.218] (II) DAEMON: Session "/usr/share/xsessions/xfce.desktop" selected, command: "startxfce4"
[06:39:11.228] (II) HELPER: [PAM] Starting...
[06:39:11.228] (II) HELPER: [PAM] Authenticating...
[06:39:11.228] (II) HELPER: [PAM] Preparing to converse...
[06:39:11.228] (II) HELPER: [PAM] Conversation with 1 messages
[06:39:11.232] (II) HELPER: [PAM] returning.
[06:39:11.233] (II) DAEMON: Authenticated successfully
[06:39:11.235] (II) HELPER: Starting: "/usr/share/sddm/scripts/Xsession \"startxfce4\""
[06:39:11.236] (II) HELPER: Adding cookie to "/home/christian/.Xauthority"
[06:39:11.241] (II) DAEMON: Session started
[06:39:11.262] (II) HELPER: [PAM] Closing session
[06:39:11.263] (II) HELPER: [PAM] Ended.
[06:39:11.263] (II) DAEMON: Auth: sddm-helper exited successfully
[06:39:11.264] (II) DAEMON: Greeter stopped.


/var/log/Xorg.0.log befindet sich hier: https://dpaste.com/HL7W64WUZ

Interessanter Auszug hiervon:

Code:
[    18.708] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration


Hat jemand eine Idee woran das liegen könnte?

Ich bin für jeden Hinweis dankbar.
_________________
#1 Ryzen 7 2700 | Asus ROG Strix X470-F Gaming | G.Skill 32 GB DDR4-3000 | PowerColor Radeon RX 5700 Red Dragon | Samsung SSD 970 EVO Plus 1TB NVMe
#2 Ryzen 5 2400G | ASRock B450 Steel Legend | G.Skill 16 GB DDR4-3000 | Samsung SSD 850 PRO 512GB SATA


Last edited by kurisu on Tue Apr 05, 2022 10:46 am; edited 1 time in total
Back to top
View user's profile Send private message
schmidicom
Veteran
Veteran


Joined: 09 Mar 2006
Posts: 1978
Location: Schweiz

PostPosted: Tue Apr 05, 2022 9:13 am    Post subject: Reply with quote

Das ist ein alter Kritikpunkt an SDDM, der startet den X11 nun mal so und so weit ich weiss lässt sich das aktuell auch nicht wirklich ändern.
Dürfte aber eh nicht mehr all zu lange relevant sein weil bei Wayland das ganze von Anfang an ohne root funktionierte und dieser den X11 über kurz oder lang ablöst.
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1889
Location: Germany

PostPosted: Tue Apr 05, 2022 9:38 am    Post subject: Reply with quote

du köntest auf den SDDM bzw. Loginmanager verzichten und über startx (und einer .xinitrc) den X11 als normaler User starten.

Bei mir sieht das dann so aus:
Code:
banana    3038  3037  2 08:54 tty1     00:03:31 /usr/bin/X -nolisten tcp -keeptty :0 -auth /tmp/serverauth.e4wZ3aAmxj vt1

_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Apr 05, 2022 9:38 am    Post subject: Reply with quote

Bei mir läuft der X-Server nicht als root:
Code:
UID      PID  PPID  C STIME TTY       TIME CMD
mike155  541   540  1 09:37 tty1  00:01:33 /usr/bin/X -nolisten tcp -keeptty :0 -auth /tmp/serverauth.XZy7gr5ijS vt1

Aber ich starte meinen X-Server auch mit 'startx' aus der TTY Konsole.

EDIT: Banana war schneller! :)
Back to top
View user's profile Send private message
Christian99
Veteran
Veteran


Joined: 28 May 2009
Posts: 1721

PostPosted: Tue Apr 05, 2022 9:42 am    Post subject: Reply with quote

Ja, das ist so ein sddm ding.
Ich hab aber gestern gesehen, dass es acct-user/sddm neu gibt. evtl wird er dann nur als sddm user gestartet, hab aber noch nicht geupdatet/ausprobiert
Back to top
View user's profile Send private message
kurisu
Apprentice
Apprentice


Joined: 19 Jan 2011
Posts: 177
Location: Munich, Germany

PostPosted: Tue Apr 05, 2022 10:45 am    Post subject: Reply with quote

Besten Dank. Ich hätte SDDM jetzt nicht unbedingt als den Schuldigen erwartet, aber nun bin ich schlauer.

Ich starte X und Xfce nun auch mittels startx und .xinitrc. Und siehe da, X läuft nicht mehr als root. Wer braucht schon einen Displaymanager ;-)
_________________
#1 Ryzen 7 2700 | Asus ROG Strix X470-F Gaming | G.Skill 32 GB DDR4-3000 | PowerColor Radeon RX 5700 Red Dragon | Samsung SSD 970 EVO Plus 1TB NVMe
#2 Ryzen 5 2400G | ASRock B450 Steel Legend | G.Skill 16 GB DDR4-3000 | Samsung SSD 850 PRO 512GB SATA
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1889
Location: Germany

PostPosted: Wed Apr 06, 2022 7:21 am    Post subject: Reply with quote

Quote:
Wer braucht schon einen Displaymanager ;-)

Den brauchste schon. Was du meinst ist der Loginmanager ;-)

Ich weiß es gibt immer Probleme und Bedenken gibt wenn was als root läuft, vor allem "dauerhaft". Aber hat man da als desktopuser (man arbeitet damit und es ist kein Server) wirklich eine Gefahr?
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
schmidicom
Veteran
Veteran


Joined: 09 Mar 2006
Posts: 1978
Location: Schweiz

PostPosted: Wed Apr 06, 2022 7:50 am    Post subject: Reply with quote

Banana wrote:
Aber hat man da als desktopuser (man arbeitet damit und es ist kein Server) wirklich eine Gefahr?

https://wiki.gentoo.org/wiki/Non_root_Xorg#Security_issues_with_running_xorg-server_as_root
Ich würde mal sagen die Antwort lautet: JA!
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Apr 06, 2022 11:07 am    Post subject: Reply with quote

Wobei man auch die Sicherheitslücken betrachten sollte, die bereits "per Design" in das X-Protokoll eingebaut sind. Die paar "Security Issues", die man durch einen X-Server als "root" zusätzlich bekommen könnte, machen mir eher geringe Sorgen.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum