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