Score:0

No permission to edit config files

gm flag

I have a problem with editing config files. E.g. in the opt/ folder. I understand that I need to do this as root. But even with

sudo gedit path/filename

it doesn’t work (see screenshot).

With sudoedit I could edit the file but when I tried to save it (overwrite the old one) I got the error message „no permission“.

I have the permission to execute sudo since „sudo -i“ works (see second pic).

I tried gedit admin/// as well. Didn’t work as well.

Of course, I tried to edit the file with a graphical editor as well. Same result.

And I tried to edit other config files (e.g. in etc/): same result.

What am I doing wrong?

(I’m a beginner with Ubuntu/Linux, so, excuse if it’s an easy to solve mistake, what I hope for!)

command sudo -i works

error message on sudo gedit command

Score:0
cn flag

We never use sudo with graphical applications. That makes a graphical application run in the environment of the user with root priviledges. That may cause changes in permissions etc. that can prevent you from logging in.

The "official" way in Ubuntu to use a graphical editor for editing system files is with the admin:/// URI, but I myself also find that unelegant, with two passwords dialogs appearing etc.

A good approach would be

EDITOR=gedit -s sudoedit /path/filename

This copies the system file to a temporary file that you edit as normal user. When the editor is closed, the system file is updated. The -s option ensures a separate instance of gedit is used, i.e., it will not connect to an existing instance so possible problems are avoided.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.