I found a (lengthy) guide to doing this but it is for gksu which is gone. I have to imagine there’s an easy way. I am running Ubuntu. There is no specific use case, it is just a feature I miss from windows.

  • Jediwan@lemy.lolOP
    link
    fedilink
    arrow-up
    4
    arrow-down
    3
    ·
    9 months ago

    The default, nautilus.

    “Run as Adminstrator” in the context menu is a default feature in Windows. It seems odd I’m the first person to want this in Linux.

    • uzay@infosec.pub
      link
      fedilink
      arrow-up
      12
      ·
      9 months ago

      It is rare that you would want to run an entire GUI program as root, and if it is needed, the program should prompt you for it. Do you have a specific use case where you need to do that regularly?

      • Jediwan@lemy.lolOP
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        9 months ago

        Not regularly, but the most common use I’ve encountered is text files used in various configurations.

        • uzay@infosec.pub
          link
          fedilink
          arrow-up
          4
          ·
          9 months ago

          Not necessarily a satisfactory solution for you, but the usual way to handle that is just using a text editor in the shell with sudo, like nano or vim. It’s pretty fast and easy once you get used to it. I don’t know if there are any good graphical ways of doing it.

    • Skull giver@popplesburger.hilciferous.nl
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      9 months ago

      There used to be an addon you could use, but I stopped using it ages ago so I’m not sure if it’s still maintained. I think it was called nautilus-admin but there was also another script.

      As a workaround, you can edit the address bar (ctrl+L, there’s no button because Gnome is weird) and add “admin://” to the start of the path. This is exactly what the addon used to do for you through a menu item.

      As an added bonus, this doesn’t require you to run nautilus (and therefore all kinds of sketchy file parsers) as root.

      As for why you seem to be the only person who wants this: running software as root has an annoying tendency to fuck up cache permissions (if environment files aren’t loaded correctly), has graphical glitches, and violates a lot of security assumptions developers make. Wireshark, for instance, will refuse to run certain code if you launch it as root because it wasn’t designed to protect the user from malicious scripts in that scenario. I’ve run programs as root for year sand I’ve seen the many ways in which it’ll subtly mess up your system.

      There’s nothing preventing you from adding a context menu item to launch programs as root, but it’s not an included feature for good reason.

      • Jediwan@lemy.lolOP
        link
        fedilink
        arrow-up
        4
        ·
        9 months ago

        ctrl+L, there’s no button because Gnome is weird

        Oh my gosh, this is so useful. The lack of an address bar was driving me insane. Thanks.

    • zelifcam@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 months ago

      You’re not the first person to want this in Linux. As others mentioned, a form of it is built in. Much like windows apps that require elevated privileges. Similarly Linux apps will prompt for a password during launch if required on a properly configured OS. I’m not going to argue that it shouldn’t exist. I’ve rarely ever run a sudo from the terminal, but the few times I have over the last decade+, Dolphin file manager has a nice option for the terminal built into it which makes it easy.

    • calm.like.a.bomb@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      arrow-down
      4
      ·
      9 months ago

      You have no idea what that would do in Linux. First read some documentation, then decide if you really need it. I guess you can see by the number of people trying to put you on the right path that what you want is not a good idea.

      • Jediwan@lemy.lolOP
        link
        fedilink
        arrow-up
        4
        arrow-down
        2
        ·
        9 months ago

        I’m not a child with a machine gun, I just don’t want to go to the terminal every time.