| DOASEDIT(8) | System Manager's Manual | DOASEDIT(8) |
NAME
doasedit — edit a
text file with root access as a non-root user
SYNOPSIS
doasedit |
file |
DESCRIPTION
The doasedit utility opens an editor on a
temporary copy of a text file. Once the file has been altered, it is written
back to the original location, using doas for elevated access. This is
intended for use in editing configuration files where the user may need to
be root to edit a file, but does not wish to run their text editor as the
super user.
The doasedit utility accepts one argument, the file to be edited.
The text editor used during the editing process is set using the VISUAL
environment variable. If VISUAL is not set
EDITOR is tried instead. If both environment
variables are not set then vi(1) is
used as a fallback.
By default doasedit will create a
temporary file in TMPDIR. If
TMPDIR is not set it will fallback to using
/tmp.
When editing a file the DOASEDIT_EDITING
environment variable will be set to the absolute path of
file. Editors can use this to ensure that
filetype-specific configurations are properly applied.
EXIT STATUS
The doasedit utility exits 0 on
success, and >0 if an error occurs.
ENVIRONMENT
DOASEDIT_EDITING- The absolute path to the root-protected file currently being edited.
EDITOR- The editor to use to edit the target text file if
VISUALis not set. If theEDITORvariable is not set, then the command vi(1) is used. TMPDIR- The directory in which to create the temporary file copy to edit. If the
TMPDIRvariable is not set, /tmp will be used as a fallback. VISUAL- The editor to use to edit the target text file. If the
VISUALvariable is not set, thenEDTIORis used as a fallback.
SEE ALSO
AUTHORS
The doasedit utility and manual page were
originally written by Jesse Smith
<jessefrgsmith@yahoo.ca>,
but are now maintained by Thomas Voss
<mail@thomasvoss.com>.
| Match 25, 2026 | Void Linux |