I'm trying to move my OS configuration over to org mode, and in the process I'd like to be able to tangle to write-protected directories like /etc
Unfortunately, tangle doesn't seem to work whenever the target file needs elevated permissions. So for instance, using
org-babel-tangle works on this code block
#+BEGIN_SRC sh :tangle psmouse.conf options psmouse synaptics_intertouch=1 #+END_SRC
but trying to tangle this one will ask me for my password (which I can give just fine) and then promptly fail
#+BEGIN_SRC sh :tangle /sudo::/etc/modprobe.d/psmouse.conf options psmouse synaptics_intertouch=1 #+END_SRC
The error message I get in the minibuffer says
Copying directly failed. See buffer '*tramp/sudo root@pop-os*' for details
But the weird part is, although the buffer mentioned above is created on error, it's actually empty.
My Messages buffer is a little bit more informative as to what's going on
Setting up indent for shell type bash Indentation variables are now local. Indentation setup for shell type bash Copying /tmp/tramp.l6Xnsw.conf to /sudo:root@pop-os:/etc/modeprobe.d/psmouse.conf...failed tramp-error: Copying directly failed, see buffer ‘*tramp/sudo root@pop-os*’ for details.