I have done this a ton of times in the past 10 months or so that I have been using Emacs (which I have quickly come to love, by the way) and never had a problem. No clue what I changed or how, but now this does not work at all. As far as I know, I didn't change anything. Haven't edited my init.el or similar, haven't changed any configurations on my host machine. No clue what's going on here.

I have the below in my init.el to open dired and then opening files from there to edit when I need to edit with privileges.

(require 'tramp) (defun sudired () (interactive) (dired "/sudo::/"))

That has served me well for months. Now, I open dired and open a file (say /boot/config.txt), do my edits, C-x C-s, and I get the message "Copying directly failed, see buffer 'tramp/sudo root@HOST' for details." There buffer it mentions is empty. My messages buffer has this:

Saving file /sudo:root@HOST:/boot/config.txt... Renaming /sudo:root@HOST:/boot/config.txt to /sudo:root@HOST:/boot/config.txt~...done Copying /tmp/tramp.eqRQkH.txt to /sudo:root@HOST:/boot/config.txt... Copying directly failed, see buffer ‘tramp/sudo root@HOST’ for details.

I've searched around and found similar problems involving Tramp... Nothing that helps my issue though. At least not that I can work out.

Same thing happens when I try to use C-x C-f and type out /sudo:root@HOST:/boot/config.txt, do my edits, and then C-x C-s. I get those same error messages, etc.

Probably making a noob mistake here. Someone school me please.

  • It's not you. tramp-mode has a bad bug. It has a couple of really bad bugs.
    – yujaiyu
    Nov 12, 2021 at 1:30
  • Michael was able to sort this out for me via email. As I remember, the issue had to do with an out of place/bad argument to a cp command somewhere inside tramp. It is/was a bug that had been fixed, so an update to tramp (and ultimately my version of emacs) solved my woes. Nov 14, 2021 at 17:27

1 Answer 1


Hard to say what's up. Please contact the Tramp tower via email to [email protected]. Prepare traces with level 6 and send them with, the Tramp manual teaches you how to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.