3 releases (1 stable)

1.0.0 Oct 4, 2020
0.1.1 Sep 28, 2020
0.1.0 Sep 27, 2020

#28 in #sudo

MIT license

24KB
190 lines

Table of Contents

  1. What is this?
  2. Installation
    1. AUR
    2. crates.io (rusts package manager)
    3. From the release page
  3. Usage:
  4. Security

yas - a (kind of) sudo replacement (entire readme is still work in progress)

What is this?

yas, or ’yet another sudo’, is kind of a sudo replacement, written in rust and without really any configuration options or not needed features. It is intended for single user systems only, as it works out of the box, with no configuration needed, but you also can’t restrict a user from running stuff as root. yas also can’t run commands as any other user, but root. In case you really do have a user, that shouldn’t be allowed to run stuff as root, this isn’t for you.

Installation

AUR

There is a AUR package for the git version of yas, you can install it with a AUR helper, or just git clone it manually:

git clone ssh://aur@aur.archlinux.org/yas-git.git
cd yas-git
makepkg -is

or:

yay -S yas-git

crates.io (rusts package manager)

Get it from crates.io with rusts cargo, by running:

cargo install yas

NOTE: The suid bit will not be set, you will manually have to set it for yas to work:

su -c "chown root ~/.cargo/bin/yas && chmod u+s ~/.cargo/bin/yas"

From the release page

  1. Download a binary

  2. Change the owner to root

    chmod root yas

  3. Set the suid bit

    chmod u+s yas

  4. Put it somewhere in your path, such as /usr/bin

Usage:

yas - execute commands as the root user

usage: yas [-h/--help] [-v/--version ]<command> <arguments for the command, this can be chained infinite>

As one can see, there aren’t really any options for yas. 99% of the people who use sudo (or opendoas), just use it with default configuration and the default options. Who would also need a flag, to edit a file, if nobody ever uses that, and instead just runs `sudo `

Security

you could have a car that is very safe by just limiting its max speed to 20 miles an hour but I don’t want to do that I want to have something that’s more like a Lamborghini so maybe I’ll throw in some airbags and it’s gonna be mostly up to the driver to protect themselves and drive it safely

Mental Outlaw on youtube

yas will ask for the password whenever you want to run a command privileged, unless you ran a command with yas in the last 5 minutes. Not however, that this is cross terminal, but i am planning on fixing that.

yas doesn’t ship with so many security features, as sudo, so if you want the most secure root commmand executor, you should also use sudo.

Dependencies

~1.3–2.5MB
~43K SLoC