Open Menu
AllLocalCommunitiesAbout
lotide
AllLocalCommunitiesAbout
Login

What is the fundamental difference between sudo and doas ?

⁨30⁩ ⁨likes⁩

Submitted ⁨⁨1⁩ ⁨day⁩ ago⁩ by ⁨TheViking@nord.pub⁩ to ⁨[deleted]⁩

source

Comments

Sort:hotnewtop
  • BananaTrifleViolin@piefed.world ⁨1⁩ ⁨day⁩ ago
    • Su = Switch User / Substitute User; it allows you to run a full shell as another user. It can be any user, but if you don’t specify then it’ll open a shell as the root user with the elevated privileges has. It allows you to do everything the root user can while that shell is still open, until you exit.

    • Sudo = SuperUser Do; it allows you to run one command with elevated privileges as the root user. Once it’s done the command it usually then ends, but there are some QOL where you can run sudo again and may not need to reenter the root password again for a certain time.

    • Doas = Dedicated Openbsd Application Subexecutor (seriously). It’s an alternative to Sudo that originated in Openbsd that also allows users to run a command with elevated privilages as the root user. Its code is smaller and tighter, and is seen as more secure than Sudo. It also has much more straight forward configuration. It’s newer than Sudo, so although Doas is in theory better, Sudo is the default widely used tool across the vast majority of Linux.

    source
    • Goun@lemmy.ml ⁨22⁩ ⁨hours⁩ ago

      You can actually also launch a full interactive shell with sudo -i but it’s not really used much as it’s easier to just type su and use that tool instead.

      su asks for the target user password, while sudo asks for your password, tho, if I’m not mistaken

      source
      • muntedcrocodile@hilariouschaos.com ⁨17⁩ ⁨hours⁩ ago

        Kinda. Yes Su asks for the target user password unless run as root eg sudo su. Sudo checks against the sudoers file and based on the contents decides what to do. You need to be added to the sudoers file or usergroup and the sudo config defines if it asks for ur password the root password or no password I assume their are other options but I never played with them.

        source
    • corsicanguppy@lemmy.ca ⁨1⁩ ⁨day⁩ ago

      Dedicated Openbsd Application Subexecutor

      That’s got to be a convoluted Backronym.

      source
    • TheViking@nord.pub ⁨1⁩ ⁨day⁩ ago

      Sudo is widely used, while Doas is in theory better ??

      source
      • BananaTrifleViolin@piefed.world ⁨1⁩ ⁨day⁩ ago

        Yeah, Sudo has been around for ages and is in pretty much every distro. So Doas just hasn’t really taken off due to inertia. You can install it yourself in many distros, but people tend to default to what they know. I’m not sure if any distros default to it. Also tutorials all over the internet use “sudo” so it kinda embeds it more as THE tool.

        It’s similar with a lot of the core GNU utilities. For example “ls” lists directories and it’s everywhere, but there are actually better written newer alternatives. They just aren’t as widespread because people tend to use the GNU utilities together. I personally like eza for example.

        source