A replacement for sudo

Why:question:

Its name looks like something that happens to me after I eat old food :exploding_head:. He should name it something bada** like MikeTyson.
Hey MikeTyson chmod 755 /home/user/.config/picom sound better.

I see! That is a pretty solid reason for the lack of confidence :sweat_smile:

BTW, try keeping away from old food :wink:

1 Like

thank you. I try to be constructive :grin:

Maybe you could ask the devs to deliver a systemd service for bad stomachs on old food :rofl:

2 Likes

Maybe because he’s right and there’s no need to discuss anything. Problem is, it’s not the only app with SUID permission.

You’re right. If it ain’t broke, don’t fix it. Admittedly, though, I do want to try run0 out mostly because I want to the eye candy it provides :sweat_smile:

1 Like

Yeh it works … but i like the password to be in terminal not GUI :frowning:
And im not sure how to force , yay to want run0 insted of sudo

core-testing/systemd 256rc4-1 [installed]
    system and service manager
run0 --help
run0 [OPTIONS...] COMMAND [ARGUMENTS...]

Elevate privileges interactively.

  -h --help                       Show this help
  -V --version                    Show package version
     --no-ask-password            Do not prompt for password
     --machine=CONTAINER          Operate on local container
     --unit=UNIT                  Run under the specified unit name
     --property=NAME=VALUE        Set service or scope unit property
     --description=TEXT           Description for unit
     --slice=SLICE                Run in the specified slice
     --slice-inherit              Inherit the slice
  -u --user=USER                  Run as system user
  -g --group=GROUP                Run as system group
     --nice=NICE                  Nice level
  -D --chdir=PATH                 Set working directory
     --setenv=NAME[=VALUE]        Set environment variable
     --background=COLOR           Set ANSI color for background

See the run0(1) man page for details.
man run0
RUN0(1)                                                                                                              run0                                                                                                              RUN0(1)

NAME
       run0 - Elevate privileges

SYNOPSIS

       run0 [OPTIONS...] [COMMAND...]

DESCRIPTION
       run0 may be used to temporarily and interactively acquire elevated or different privileges. It serves a similar purpose as sudo(8), but operates differently in a couple of key areas:

       •   No execution or security context credentials are inherited from the caller into the invoked commands, as they are invoked from a fresh, isolated service forked off by the service manager.

       •   Authentication takes place via polkit[1], thus isolating the authentication prompt from the terminal (if possible).

       •   An independent pseudo-tty is allocated for the invoked command, detaching its lifecycle and isolating it for security.

       •   No SetUID/SetGID file access bit functionality is used for the implementation.

       Altogether this should provide a safer and more robust alternative to the sudo mechanism, in particular in OS environments where SetUID/SetGID support is not available (for example by setting the NoNewPrivileges= variable in
       systemd-system.conf(5)).

       Any session invoked via run0 will run through the "systemd-run0" PAM stack.

       Note that run0 is implemented as an alternative multi-call invocation of systemd-run(1).

OPTIONS
       The following options are understood:

       --no-ask-password
           Do not query the user for authentication for privileged operations.

           Added in version 256.

       --unit=
           Use this unit name instead of an automatically generated one.

           Added in version 256.

       --property=
           Sets a property on the service unit that is created. This option takes an assignment in the same format as systemctl(1)'s set-property command.

           Added in version 256.

       --description=
           Provide a description for the service unit that is invoked. If not specified, the command itself will be used as a description. See Description= in systemd.unit(5).

           Added in version 256.

       --slice=
           Make the new .service unit part of the specified slice, instead of user.slice.

           Added in version 256.

       --slice-inherit
           Make the new .service unit part of the slice the run0 itself has been invoked in. This option may be combined with --slice=, in which case the slice specified via --slice= is placed within the slice the run0 command is invoked
           in.

           Example: consider run0 being invoked in the slice foo.slice, and the --slice= argument is bar. The unit will then be placed under foo-bar.slice.

           Added in version 256.

       --user=, -u, --group=, -g
           Switches to the specified user/group instead of root.

           Added in version 256.

       --nice=
           Runs the invoked session with the specified nice level.

           Added in version 256.

       --chdir=, -D
           Runs the invoked session with the specified working directory. If not specified defaults to the client's current working directory if switching to the root user, or the target user's home directory otherwise.

           Added in version 256.

       --setenv=NAME[=VALUE]
           Runs the invoked session with the specified environment variable set. This parameter may be used more than once to set multiple variables. When "=" and VALUE are omitted, the value of the variable with the same name in the
           invoking environment will be used.

           Added in version 256.

       --background=COLOR
           Change the terminal background color to the specified ANSI color as long as the session lasts. If not specified, the background will be tinted in a reddish tone when operating as root, and in a yellowish tone when operating
           under another UID, as reminder of the changed privileges. The color specified should be an ANSI X3.64 SGR background color, i.e. strings such as "40", "41", ..., "47", "48;2;...", "48;5;...". See ANSI Escape Code (Wikipedia)[2]
           for details. Set to an empty string to disable.

           Example: "--background=44" for a blue background.

           Added in version 256.

       --machine=
           Execute operation on a local container. Specify a container name to connect to.

           Added in version 256.

       -h, --help
           Print a short help text and exit.

       --version
           Print a short version string and exit.

       All command line arguments after the first non-option argument become part of the command line of the launched process. If no command line is specified an interactive shell is invoked. The shell to invoke may be controlled via
       --setenv=SHELL=...  and currently defaults to the originating user's shell (i.e. not the target user's!) if operating locally, or /bin/sh when operating with --machine=.

EXIT STATUS
       On success, 0 is returned. If run0 failed to start the session or the specified command fails, a non-zero return value will be returned.

ENVIRONMENT VARIABLES
       As with systemd-run, the session will inherit the system environment from the service manager. In addition, the following environment variables will be set:

       $TERM
           Copied from the $TERM of the caller. Can be overridden with --setenv=

           Added in version 256.

       $SUDO_USER
           Set to the username of the originating user.

           Added in version 256.

       $SUDO_UID
           Set to the numeric UNIX user id of the originating user.

           Added in version 256.

       $SUDO_GID
           Set to the primary numeric UNIX group id of the originating session.

           Added in version 256.

SEE ALSO
       systemd(1), systemd-run(1), sudo(8), machinectl(1)

NOTES
        1. polkit
           https://www.freedesktop.org/wiki/Software/polkit

        2. ANSI Escape Code (Wikipedia)
           https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters

systemd 256~rc4                                                                                                                                                                                                                        RUN0(1)

“Authentication takes place via polkit[1], thus isolating the authentication prompt from the terminal (if possible).”

yeh … so is there some experimentator who already system wide replaced sudo with alias that points sudo to Run0 … so yay and others will benefit from Run0 ???
I dont want to breake my system right now (it was lots of work to get it in for my to working condition → and still im not sattisfied enouf with the result :smiley: )

Played with run0 and so far things are going rather smooth but using run0 with meld failed.