Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

howto/rootless: Add setcap alternative #796

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ effinger
egid
EID
Eing
eip
ekh
emacs
emaillookup
Expand Down Expand Up @@ -868,6 +869,7 @@ seqno
SERVERBUG
servermetadata
SETACTIVE
setcap
setcred
setra
setspn
Expand Down
30 changes: 28 additions & 2 deletions source/configuration_manual/howto/rootless.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@ example configuration file exists in
``~/dovecot/share/doc/dovecot/example-config/`` and needs to be copied
to ``~/dovecot/etc/dovecot/``.

Add capabilities
----------------

Modern linux systems support capabilities which allows you to permit
selective rights to processes. This allows you to run dovecot rootless
without losing chroot and privileged ports.

Use following commands to enable this

.. code:: bash

setcap cap_net_bind_service+ep ~/dovecot/sbin/dovecot
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/script-login
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/imap-urlauth-login
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/submission-login
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/managesieve-login
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/pop3-login
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/imap-login
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/lmtp
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/anvil

# if you have installed managesieve
setcap cap_sys_chroot+ep ~/dovecot/libexec/dovecot/managesieve-login

Configuration
-------------

Expand All @@ -61,7 +85,8 @@ The important settings to change for rootless installation are:
default_login_user = user
default_internal_group = group

- Remove default chrooting from all services:
- Remove default chrooting from all services, this is optional if you want
to use Linux capabilities instead.

::

Expand All @@ -75,7 +100,8 @@ The important settings to change for rootless installation are:
chroot =
}

- Change listener ports:
- Change listener ports, this is optional if you want to use Linux
capabilities instead

::

Expand Down