]> git.armaanb.net Git - opendoas.git/blob - README.md
Update LICENSE and README
[opendoas.git] / README.md
1 # OpenDoas
2
3 > a portable version of OpenBSD's `doas` command
4
5 `doas` is a minimal replacement for the venerable `sudo`. It was
6 initially [written by Ted Unangst](http://www.tedunangst.com/flak/post/doas)
7 of the OpenBSD project to provide 95% of the features of `sudo` with a
8 fraction of the codebase.
9
10 This fork insults you, similar to `sudo`.
11
12 ## Building and installation discouragements
13
14 There are a few steps you have to carefully consider before building and installing
15 opendoas:
16
17 * There are less eyes on random doas ports, just because sudo had a vulnerability
18   does not mean random doas ports are more secure if they are not reviewed
19   or pam is configured incorrectly.
20 * If you want to use pam; You have to [configure pam](#pam-configuration)
21   and failing to do so correctly might leave a big open door.
22 * Use the configure script.
23 * Use the default make target.
24 * If you really want to install a setuid binary that depends on
25   pam being correctly configured, use the make install target
26   to install the software.
27
28 ## About the port
29
30 This is not an official port/project from OpenBSD!
31
32 As much as possible I've attempted to stick to `doas` as tedu desired
33 it. As things stand it's essentially just code lifted from OpenBSD with
34 PAM or shadow based authentication glommed on to it.
35
36 Compatibility functions in libopenbsd come from openbsd directly
37 (`strtonum.c`, `reallocarray.c`, `strlcpy.c`, `strlcat.c`),
38 from openssh (`readpassphrase.c`) or from sudo (`closefrom.c`).
39
40 The PAM and shadow authentication code does not come from the OpenBSD project.
41
42 ### pam configuration
43
44 I will not ship pam configuration files, they are distribution specific and
45 its simply not safe or productive to ship and install those files.
46
47 If you want to use opendoas on your system and there is no package that
48 ships with a working pam configuration file, then you have to write and
49 test it yourself.
50
51 A good starting point is probably the distribution maintained `/etc/pam.d/sudo`
52 file.
53
54 ### Persist/Timestamp/Timeout
55
56 The persist feature is disabled by default and can be enabled with the configure
57 flag `--with-timestamp`.
58
59 This feature is new and potentially dangerous, in the original doas, a kernel API
60 is used to set and clear timeouts. This API is openbsd specific and no similar API
61 is available on other operating systems.
62
63 As a workaround, the persist feature is implemented using timestamp files
64 similar to sudo.
65
66 See the comment block in `timestamp.c` for an in-depth description on how
67 timestamps are created and checked to be as safe as possible.