Is it possible to open a file(in root location) as non-root user in Emacs, edit it and then when its time to save provide the password so the Emacs can get write to the file? Better still provide different buffers with different user privileges?
I know of Tramp
but couldn't get my head around it.
Here's how I do it:
(require 'tramp)
(defun sudired ()
(interactive)
(dired "/sudo::/"))
You'll get a dired
buffer where you have root privileges.
Any subsequent directory or file that you open from here will be with root.
Any other dired
buffers will not be affected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With