Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I open a file for edit as root with Aquamacs?

I'm using Aquamacs to do most of my text editing, and would like to, selectively, open some files as root when editing them.

Is there a way for me to open some files as root with Aquamacs (and not the rest)?

I know that I can just start Aquamacs with a sudo command, but that's a bit too risky for me - I'd rather only have root permissions for editing files which absolutely require it.

like image 229
blueberryfields Avatar asked Jan 27 '26 14:01

blueberryfields


1 Answers

You can open a file as root using TRAMP (bundled with Emacs since version 22.1):

C-x C-f /sudo:root@localhost:/path/to/file RET

If you don't insert the username@host part, TRAMP defaults to root@localhost when using /sudo, so you can shorten the syntax to

C-x C-f /sudo::/path/to/file RET

like image 189
giordano Avatar answered Jan 30 '26 06:01

giordano