I am trying to run commands from a root shell as other users. I am trying to remove
sudo
from it:
systemd-run --user --pty --same-dir --wait --service-type=exec sudo -u ubuntu make
I tried:
systemd-run --pty --same-dir --wait --service-type=exec --uid=1000 make
(removed --user
as it only works on system context, added --uid= despite it being equivalent to unit's User= it only works on uid, and removed sudo -u ubuntu
from the cmd)
> Failed to start transient service unit: Transport endpoint is not connected
Only mentions I've found of this cryptic error are about machinectl container/vms/remotes not being started. But in my case i'm using the systemd system of the very host.
What is the correct way to use --uid
parameter on systemd-run
?
Asked by gcb
(632 rep)
May 22, 2024, 07:28 PM