You can open SSH resources in Emacs. Unfortunately, the pathspec used for SSH resources conflicts with possible paths in the virtual file system.

If I run

sudo mkdir "/ssh:example.com"
sudo touch "/ssh:example.com/file"

, I cannot figure out a way to edit the file I just created via Emacs except moving it or creating another hard link. Is there a way to edit this file in Emacs if you can't do that, for example because you don't have write privileges in the directory where the file is?

1 Answer 1


Try C-x C-f /:/ssh:example.com/file RET

The /: prefix is a magic thingy which prevents other magic thingies from interfering.

  • Thank you. This technically answers the question which is why I already accepted the answer. But can I also open that folder in dired?
    – UTF-8
    Commented May 17, 2018 at 16:13
  • @UTF-8: Of course: C-x C-f /:/ssh:example.com/ RET
    – Stefan
    Commented May 18, 2018 at 2:33
  • This causes this error message to appear in the mini buffer: Host name must not match method "ssh" No dired buffer is opened. The *Messages* buffer says: tramp-file-name-handler: Host name must not match method "ssh"
    – UTF-8
    Commented May 18, 2018 at 11:07
  • I already wrote a bug report and wanted to make sure the problem occurs in the latest development version of Emacs before sending the email to the mailing list. Turns out it doesn't. But if you add a colon to the end, it does again. So in the latest version, you can't access the directory /ssh:exaple.com:
    – UTF-8
    Commented May 18, 2018 at 11:35
  • Should anyone come across this question because they actually suffer from this bug and want a link to the discussion of the bug on the mailing list: debbugs.gnu.org/cgi/bugreport.cgi?bug=31489
    – UTF-8
    Commented May 18, 2018 at 13:33

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.