From owner-dev-commits-doc-all@freebsd.org Sat Mar 6 12:05:09 2021 Return-Path: Delivered-To: dev-commits-doc-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E53ED565035 for ; Sat, 6 Mar 2021 12:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dt3Fd64ygz3pfx; Sat, 6 Mar 2021 12:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3C3B23374; Sat, 6 Mar 2021 12:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 126C59ed013573; Sat, 6 Mar 2021 12:05:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 126C59xd013572; Sat, 6 Mar 2021 12:05:09 GMT (envelope-from git) Date: Sat, 6 Mar 2021 12:05:09 GMT Message-Id: <202103061205.126C59xd013572@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Gordon Bergling Subject: git: 180b5eb083 - main - Handbook: Add a small chapter about doas as an alternative to sudo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 180b5eb083c859f2c462d249604327605ab3f922 Auto-Submitted: auto-generated X-BeenThere: dev-commits-doc-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the doc repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 12:05:10 -0000 The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/doc/commit/?id=180b5eb083c859f2c462d249604327605ab3f922 commit 180b5eb083c859f2c462d249604327605ab3f922 Author: Gordon Bergling AuthorDate: 2021-03-06 12:02:42 +0000 Commit: Gordon Bergling CommitDate: 2021-03-06 12:02:42 +0000 Handbook: Add a small chapter about doas as an alternative to sudo doas is a viable alternative to sudo, so it is worth to be mentioned in our handbook. Reviewed by: 0mp (early version) Differential Revision: https://reviews.freebsd.org/D28483 --- .../content/en/books/handbook/security/_index.adoc | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/documentation/content/en/books/handbook/security/_index.adoc b/documentation/content/en/books/handbook/security/_index.adoc index d07f9f0413..1cb02b6f8d 100644 --- a/documentation/content/en/books/handbook/security/_index.adoc +++ b/documentation/content/en/books/handbook/security/_index.adoc @@ -2125,3 +2125,26 @@ While sessions are logged, any administrator is able to remove sessions and leav ==== The `sudoreplay` is extremely extendable. Consult the documentation for more information. + +[[security-doas]] +As an alternative to package:security/sudo[] package:security/doas[] can be used to provide the ability for users to get enhanced privileges. + +The doas utility is available via the ports collection in package:security/doas[] or via the man:pkg[8] utility. + +After the installation [.filename]#/usr/local/etc/doas.conf# must be configured to grant access for users for specific commands, or roles. + +The simpliest entry could be the following, which grants local_user root permissions without asking for its password when executing the doas command. + +[source,bash] +.... +permit nopass local_user as root +.... + +For more configuration examples, please read man:doas.conf[5]. + +After the installation and configuration of the `doas` utility, a command can now be executed with enhanced privileges, like for example. + +[source,bash] +.... +$ doas vi /etc/rc.conf +....