Timeline for How to edit and save an extremely stubborn read-only file
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 2, 2018 at 22:50 | vote | accept | Startec | ||
Apr 13, 2017 at 12:37 | history | edited | CommunityBot |
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
|
|
Mar 20, 2017 at 10:18 | history | edited | CommunityBot |
replaced http://superuser.com/ with https://superuser.com/
|
|
Oct 16, 2016 at 10:23 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Sep 16, 2016 at 8:28 | answer | added | phils | timeline score: 6 | |
Sep 16, 2016 at 7:18 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Aug 19, 2016 at 7:45 | comment | added | MAP |
The way I do this (well, not for the main.cf file, but for other files in /etc/postfix ) is using group permissions. Since I'm in the root group, which is the normal group for those files, you can just set the files you want to edit to g+w and then edit at your leisure. But only change the permissions on the files you really need lest you accidentally break things.
|
|
Aug 17, 2016 at 5:08 | answer | added | chen bin | timeline score: 1 | |
Aug 16, 2016 at 21:13 | comment | added | amitp |
If I understand right, you don't own that file, so you can't change the permissions on it with C-x C-q , nor can you change the permissions with wdired. You have to switch to root using sudo to edit files you don't own. I use a variant of Burton's answer in the link Aaron gave.
|
|
Aug 16, 2016 at 19:42 | comment | added | Aaron Miller | Well, if you're not actually running Emacs as root (which you shouldn't!), then the "sudo filename trick" is the correct solution - you need to elevate privilege somehow to edit the file, and Tramp's sudo transport is the way to do so. It sounds like you might really benefit from a package that'll automatically reopen files requiring elevation via the sudo transport, instead of making you do it by hand; this Stack Overflow thread has a wide variety of options, on none of which I'm qualified to comment. | |
Aug 16, 2016 at 19:32 | history | asked | Startec | CC BY-SA 3.0 |