Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
46
rated 0 times [  46] [ 0]  / answers: 1 / hits: 310228  / 2 Years ago, fri, august 19, 2022, 8:42:23

I can't seem to edit and save config files in the root system (eg: /etc/dhcp/dhcpd.config); it just says "permission denied" or the save option is blocked in the text editor.



I'm pretty sure I'm a root user, but how do I make sure? If I am a root user, how do I fix this?


More From » permissions

 Answers
6

Which text editor are you using? If you are a sudoer and know your password, try (in a terminal) either:



  • sudoedit /etc/dhcp/dhcpd.config if you are using a terminal-based editor such as nano or are ssh'ing into a server.

  • gedit admin:///etc/dhcp/dhcpd.config using the the admin:// protocol with GNOME applications such as gedit (and others that support GVfs).

  • sudo -H <text editor> /etc/dhcp/dhcpd.config for GUI editors in general.

  • In old versions of Ubuntu, gksudo <text editor here> /etc/dhcp/dhcpd.config could be used to launch GUI editors.


In either case, you'll need to first provide your password when requested.


In Ubuntu 14.04 onwards, gksudo is not installed by default. You will have to install the gksu package (either from the Software Centre or via sudo apt-get install gksu) to get it.


In Ubuntu 17.10, Wayland is default instead of the traditional X server, and running graphical editors as root is difficult. See Why don't gksu/gksudo or launching a graphical application with sudo work with Wayland? for details.


In Ubuntu 18.04, gksudo is not available in the official repositories.


[#41161] Sunday, August 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atetamme

Total Points: 11
Total Questions: 121
Total Answers: 109

Location: Puerto Rico
Member since Sun, Jun 27, 2021
3 Years ago
;