Editing configuration files

Ralf Mardorf silver.bullet at zoho.com
Fri Nov 23 18:48:30 UTC 2018


On Fri, 23 Nov 2018 18:29:05 +0000, Ian Bruntlett wrote:
>What is the preferred way to edit text configuration files that require
>root access?

Hi,

it depends on the config file you want to edit. If you want to edit
/etc/sudoers you should use visudo, since it locks the file and checks
the file's syntax. The "vi" in visudo doesn't mean that you must use
"vi", you could use the another editor, since by default it cares about
the VISUAL and EDITOR variables. I'm using nano, for visudo, but
sometimes I'm even using dconf based GUI editors for some config
files, which could lead to /run/user/*/dconf/user owner issues, that
could be resolved by simply deleting /run/user/*/dconf/user after
usage. OTOH some GUI editors aren't that odd, for example xfw could be
used and doesn't cause such an owner issue. I sometimes like to use meld
to edit files and to compare it with backups or "new" files installed
by an upgrade, while the old file is kept.

2 Cents,
Ralf




More information about the ubuntu-users mailing list