musv Advocate
Joined: 01 Dec 2002 Posts: 3337 Location: de
|
Posted: Sun Feb 04, 2024 12:35 am Post subject: sudo root + su user in Wayland - No display |
|
|
Hi there,
I'm running a configuration with a LAN interface (eth) and a wifi interface (wifi). Via network namespaces I use 2 networks on my computer for different user:
- user A → eth0
- user B → wlan0
In X this worked without any problems. I used a keyboard shortcut to switch from user A to user B:
Code: | sudo /usr/sbin/ip netns exec nswifi su - userb -c urxvt |
Now I got a new computer and switched to KDE with Wayland. If I do this on Wayland:
Code: | sudo /usr/sbin/ip netns exec nswifi su - userb -c urxvt
urxvt: can't open display :0, aborting. |
To avoid this problem and additionally get Pipewire running, I tried ego (Gentoo-Forums).
That works, if I switch from userA→userB, but doesn't work for userA → sudo → userB.
How can I use graphical applications, e.g. Firefox/Chromium with userB?
----------- Explain Netnamespaces --------------
Code: | ip netns add nswifi
ip netns exec nswifi ip addr add 127.0.0.1/8 dev lo
ip netns exec nswifi ip link set lo up
iw phy phy0 set netns name nswifi
ip netns exec nswifi ip link set wifi0 up
ip netns exec nswifi systemctl start wpa_supplicant
ip netns exec nswifi dhcpcd -C resolv.conf wifi0
ip netns exec nswifi su - userb -c urxvt |
With that code I remove wifi0 from the default netnamespace, put wifi0 into nswifi netnamespace. And with the last command userB doesn't see anymore eth0 but can now use the network established for wifi0. Both networks don't see each other. |
|