Il 03/01/2024 17:41, Greg Wooledge ha scritto:

The UID of 1000 will have to be verified, as well as the YOURUSER.
UID 1000 is what Debian uses for the initial user account that's
created during installation, but if for some reason that's not the
account who's currently logged in, then obviously this won't work.

In my case it's ok

The su command is not an ideal choice for this, in fact.  The setpriv(1)
command is better suited for running programs as other user accounts,
without doing crazy PAM stuff like su does.

Can you explain better?

It also has the advantage
of not needing a username -- it can work with just the UID.

     uid=1000 gid=1000
     setpriv --reuid "$uid" --regid "$gid" --init-groups \
       env XDG_RUNTIME_DIR=/run/user/"$uid" DISPLAY=:0 XDG_CURRENT_DESKTOP=KDE \
       keffeine >/dev/null 2>&1 &

In a (used like a) single user system like this, I know both username and uid.
In a multi-user one, you have to find them. And it doesn't seem simple.


Reply via email to