crab/readme.md

51 lines
1.9 KiB
Markdown
Raw Normal View History

2022-11-09 00:44:31 +00:00
# **Crab**
2022-11-09 05:51:47 +00:00
`Crab`, a.k.a `Cool Rust Authentication Binary` is a rusty replacement for sudo or doas on Linux systems.
2022-11-09 00:44:31 +00:00
# Installation
2022-11-09 03:07:02 +00:00
### From Source
2022-11-11 20:16:37 +00:00
To be able to build the package, you need cargo wich you can get either though rust or rust up.
2022-11-09 03:07:02 +00:00
2022-11-11 20:16:37 +00:00
To build, run the following commands below in the root directory of the repo. Make sure to run the shell script as root.
```bash
cargo build --release
2022-12-01 20:49:27 +00:00
chmod +x /deployments/source/install.sh
2022-11-11 20:16:37 +00:00
./deployments/source/install.sh
```
To uninstall, just run the following script as root.
```bash
2022-12-01 20:49:27 +00:00
chmod +x ./deployments/source/uninstall.sh
2022-11-11 20:16:37 +00:00
./deployments/source/uninstall.sh
```
2022-11-09 16:46:26 +00:00
2022-11-09 03:07:02 +00:00
### Arch Based Systems
2022-11-09 16:46:26 +00:00
If you are on an arch based distro, crab is avaliable on the [AUR](https://aur.archlinux.org/packages/crab) as `crab`.
2022-11-11 20:16:37 +00:00
```
paru -S crab
```
2022-11-09 00:44:31 +00:00
# Configuration
2022-11-11 20:16:37 +00:00
The default configuration file is stored in `/usr/share/crab/crab.conf` and must be coppied to `/etc/crab.conf`.
```bash
cp /usr/share/crab/crab.conf /etc/crab.conf
chown root:root /etc/crab.conf
chmod 600 /etc/crab.conf
```
Each line in the configuration specifies a different rule. Each rule is applied from top to bottom,
so the first onethat matches a user is what is used. The first word is either `permit` or `deny` to
allow or deny a certain group. Then the tags `persist` and `nopass` can be added to allow authoriziation
persistance or skipping respectively. Then a user can be specified by putting their name, or a group by a
colon then the groups name. Finally, if you dont want to run that user as root, you can add `as` and then
a user name to run the process as. All lines starting in a # will be ignored.
2022-11-09 00:44:31 +00:00
For Example
```
2022-12-01 20:49:27 +00:00
permit persist john
deny nvidia
permit :docker
permit persist nopass :wheel
2022-11-09 00:44:31 +00:00
```
2022-11-11 20:16:37 +00:00
Please make sure when editing your config that not normal users can edit the file, but only root. If normal users can edit the config, they can add themselvs as permitted and get elevated privilages.