https://github.com/illiliti/ssu
Extremely simple su utility
https://github.com/illiliti/ssu
doas su suckless sudo
Last synced: about 2 months ago
JSON representation
Extremely simple su utility
- Host: GitHub
- URL: https://github.com/illiliti/ssu
- Owner: illiliti
- License: gpl-3.0
- Created: 2020-08-27T23:08:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T11:52:38.000Z (about 3 years ago)
- Last Synced: 2024-05-08T20:04:17.904Z (almost 2 years ago)
- Topics: doas, su, suckless, sudo
- Language: C
- Homepage:
- Size: 30.3 KB
- Stars: 65
- Watchers: 9
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ssu
Extremely simple su utility
## Dependencies
* C99 compiler (gcc, clang, tcc, cproc, ...) (build time)
* POSIX make (gmake, bmake, smake, pdpmake, ...) (build time)
* POSIX libc + initgroups(3) (musl libc, glibc, *BSD libc, ...)
## Installation
```sh
# pass CC=cc macro if c99 is not available
make
# by default, only users in the wheel group can elevate privileges.
# to change the group, pass BINGRP=grp macro, where 'grp' is a desirable group.
#
# you must have appropriate privileges to run this command.
make PREFIX=/usr install
```
## Usage
Instead of using a config file, ssu offloads authentication mechanism to the
kernel by using unix permissions, which makes it simple and secure. However
simplicity comes with a cost and such mechanism is not flexible at all; it is
completely limited to the unix permissions. Therefore, ssu is only good for
those who don't need complicated setups.
Here is an example how to setup ssu for a specific group(you must be root to
run these commands):
```sh
# run 'id -gn' to see your current group.
# change 'me' to that group.
chown root:me /path/to/ssu
# allow your group to execute suid ssu and thus elevate privileges.
#
# extra(4) - setuid
# owner(7) - read, write, exec
# group(5) - read, exec
# other(4) - read
chmod 4754 /path/to/ssu
```
## Note
While using ssu, you may encounter weird errors like 'invalid option'. In order
to fix them, set `POSIXLY_CORRECT` environment variable or guard command-line
arguments with '--'.
Example with ls:
```sh
POSIXLY_CORRECT=1 ssu ls -la /root
ssu -- ls -la /root
```
See also: https://wiki.musl-libc.org/functional-differences-from-glibc.html