Is there a way to open a local file for editing as a root? I need to make some changes to a config file located at ~/.emacs.d/init.el
, but the Emacs tells me that the buffer is read-only.
Asked
Active
Viewed 167 times
0

MadPhysicist
- 153
- 6
root
. Then it does not matter in which directory the file is located. – MadPhysicist Oct 05 '17 at 20:23File /sudo:[email protected]:/var/root/.emacs.d/init.el no longer exists!
Somehow the domain name gets appended and inserted into the command automatically even though I run it asFile /sudo::/var/root/.emacs.d/init.el
– MadPhysicist Oct 05 '17 at 20:32emacs -Q
? – Gilles 'SO- stop being evil' Oct 05 '17 at 20:43/sudo::
is tramp shorthand for/sudo:root@<host>:
– phils Oct 05 '17 at 21:08$HOME
set to/var/root
? That seems kind of odd. Usually it's/root
if you are logged in as root, or/home/MadPhysicist
for a normal user calledMadPhysicist
(for example). – npostavs Oct 06 '17 at 01:13root
. On another note, if I ever wanted to connect to a remote machine and edit some files there, would I do it using the Tramp package? – MadPhysicist Oct 06 '17 at 01:15/ssh:<host>:~/.emacs
to edit your~/.emacs
file on the<host>
machine. SeeC-h i g (tramp)
for full details. If you mean to edit files on a remote machine as the root user on that machine, then see https://stackoverflow.com/q/2177687 – phils Oct 06 '17 at 06:40