• Pippipartner@discuss.tchncs.de
    link
    fedilink
    arrow-up
    7
    ·
    20 hours ago

    It feels like a potential security nightmare. If your desktop at work is compromised and you have your domain admin come over and take a look; they might decide not to elevate the whole session, exercising appropriate caution and protocol in doing so, but just wing it with a quick sudo !! because the previous command didn’t go through.

    I don’t quite remember if this works properly, but I think !! should expand to sudo “previous command” at least in bash.

    • spujb@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 hours ago

      it uses the UAC flow so it’s closer to right click > run as administrator than runas, so you will be required to enter credentials in the UAC dialogue (not the terminal) unless you are using an admin account (which at any workplace taking security seriously you should not be)

      and in powershell it’s $$ to execute the previous command :)

      disclaimer: not an admin i just use these tools