rdo/README.md

79 lines
1.9 KiB
Markdown
Raw Normal View History

# RootDO [![AUR](https://img.shields.io/aur/version/rdo.svg)](https://aur.archlinux.org/packages/rdo/)
2021-07-13 21:33:12 +02:00
2022-02-09 20:16:13 +01:00
This project aims to be a very slim alternative to both sudo and doas.
2021-07-13 21:33:12 +02:00
### Installation
If you are on Arch Linux, you can download the package via the [AUR](https://aur.archlinux.org/packages/rdo/).
You can clone and build rdo with the following set of commands:
2021-07-13 21:33:12 +02:00
```sh
2021-07-13 21:34:38 +02:00
git clone https://codeberg.org/sw1tchbl4d3/rdo
2021-07-13 21:33:12 +02:00
cd rdo
make
sudo make install
```
After that, you'll have to configure rdo to allow you to use it.
To do this, edit `/etc/rdo.conf`, and set the group variable to the admin group you are in.
2021-07-13 21:33:12 +02:00
2022-02-09 20:16:13 +01:00
Then you're good to go!
2021-07-13 21:33:12 +02:00
2022-02-09 20:16:13 +01:00
To uninstall:
2021-07-13 21:33:12 +02:00
```sh
sudo make uninstall
```
### Usage
```sh
rdo [command]
```
2021-07-15 12:44:44 +02:00
Or, to get the password from stdin:
```sh
rdo - [command]
```
The configuration file has the following variables:
```
group=wheel
wrong_pw_sleep=1000
session_ttl=5
```
- `group`: The group of users that is allowed to execute rdo.
- `wrong_pw_sleep`: The amount of milliseconds to sleep at a wrong password attempt. Must be a positive integer. Set to 0 to disable.
- `session_ttl`: The amount of minutes a session lasts. Must be a positive integer. Set to 0 to disable.
### Benchmarks
2022-12-14 14:57:22 -03:00
The benchmark: Execute `whoami` (GNU coreutils 9.1) 10000 times.
Yes, this is a silly benchmark. Yes, the performance gain in real world application is close to nothing.
But it's fun!
|Program|Time|
--- | ---
2022-12-14 14:57:22 -03:00
sudo 1.19.11 | 46.85s
doas 6.8.2 | 32.57s
rdo 1.4.2 | 13.37s
Baseline | 7.95s
2022-12-14 14:57:22 -03:00
> Baseline here is how long it took without any wrapper to make it root.
2022-12-14 14:57:22 -03:00
These benchmarks were done on a `Intel i5 7200U` processor, on a Debian 12 Docker container.
2022-12-14 14:57:22 -03:00
`sudo` and `doas` were pulled from the Debian repos, `rdo` was compiled locally.
All configs were kept as default, except allow the `wheel` group on both + enable `persist` on doas.
2022-12-14 14:57:22 -03:00
The benchmark can be executed through a Docker container by running:
```
2022-12-14 14:57:22 -03:00
make bench-build bench-run
```