[kwlug-disc] Johnny Cash: A boy name SU
Hubert Chathi
hubert at uhoreg.ca
Wed May 21 14:20:14 EDT 2014
On Wed, 21 May 2014 11:26:39 -0400, "L.D. Paniak" <ldpaniak at fourpisolutions.com> said:
> Thanks Tim! A solution to one of the great unsolved (for me at least)
> problems of the universe: how to cleanly save that file you have no
> right to save after you have made several dozen changes.
> I challenge the emacs crowd to come up with an equivalent.
Emacs has a feature called tramp that can save files using various
methods, including sudo. So you can tell emacs to, for example, save to
the file named "/sudo:localhost:/etc/hosts", and it will write to
"/etc/hosts" as root (after prompting for your password, of course). It
works for reading files as well (so you can open, say,
"/sudo:localhost:/etc/shadow" to read /etc/shadow in emacs), and can use
other methods, such as ssh or ftp for editing remote files.
You can even chain methods, such as chaining ssh and sudo to edit remote
files, as root (though I can never remember the syntax for chaining, and
always have to look it up).
--
Hubert Chathi - Email/Jabber: hubert at uhoreg.ca - http://www.uhoreg.ca/
PGP/GnuPG key: 4096R/113A1368 (Key available at pool.sks-keyservers.net)
Fingerprint: F24C F749 6C73 DDB8 DCB8 72DE B2DE 88D3 113A 1368
More information about the kwlug-disc
mailing list