Editing configuration files

Liam Proven lproven at gmail.com
Sun Nov 25 20:07:43 UTC 2018


On Fri, 23 Nov 2018 at 19:31, Ian Bruntlett <ian.bruntlett at gmail.com> wrote:
>
> Hi All,
>
> What is the preferred way to edit text configuration files that require root access?
>
> For example, I would normally use emacs to edit /etc/default/grub

Er. Depends on display server -- Wayland makes it more complicated --
but you can use your GUI editor of choice.

Open a terminal.
Do ``sudo -s'' to become root.
Navigate to the file, e.g. ``cd /etc/apt''
Open the editor, e.g. ``gedit sources.list''

That's what I do.

If apps running as root don't have permission to access the graphics
display, which I think is the default on Ubuntu but isn't on (e.g.)
openSUSE, you can add it with ``xhost+''

https://wiki.archlinux.org/index.php/Xhost

If you want a nice friendly GUI-like editor for the console, my
favourite is Tilde:

https://os.ghalkes.nl/tilde/

-- 
Liam Proven - Profile: https://about.me/liamproven
Email: lproven at cix.co.uk - Google Mail/Hangouts/Plus: lproven at gmail.com
Twitter/Facebook/Flickr: lproven - Skype/LinkedIn: liamproven
UK: +44 7939-087884 - ČR (+ WhatsApp/Telegram/Signal): +420 702 829 053




More information about the ubuntu-users mailing list