new emacs user here.

I'm trying to get tramp to work but can't figure out what's wrong. I do:

M-x councel-tramp
select /ssh:myserver

But I just get "Waiting for prompts from remote shell" and it hangs for ever. I saw this related post on stackexchange: Tramp: Waiting for prompts from remote shell

Which suggests adding

     case "$TERM" in
            export PS1="> "
            tty -s && export PS1="some crazy prompt stuff"

to the .zshrc or .bashrc, but that doesn't make a difference for me. Can someone help me fix this? Any idea what's wrong?


  • You might want to set TRAMP to be more verbose about what it's trying to do. Right now, your question requires a lot of guesswork from people looking at it, as you're only telling what error message you got, as well as one specific solution you've tried that doesn't work in your case.
    – user12563
    Apr 28, 2019 at 21:02
  • Have you ever tried to connect to that server via ssh (without using emacs)? When this is working, and there is no Yes/No prompt, then try it again from within emacs.
    – jue
    Apr 28, 2019 at 21:16
  • Are you adding that on the remote machine?
    – nega
    Apr 29, 2019 at 14:05

3 Answers 3


I found out what my particular problem was. The server I'm trying to login to, displays a fancy motd message when logging in. This ascii-art contains some characters that emacs/tramp seems to dislike, probably backslashes/slashes.

In the end I just removed the motd message and everything is fine now.


Don't try to test everything the same time. Concentrate first on Tramp. Start emacs -Q in order to suppress init files. Don't use any completion package, but load C-x C-f /ssh:myserver: directly. If this works, it isn't a Tramp issue, check the init files.

If this doesn't work, start again emacs -Q, and evaluate in the *scratch* buffer (setq tramp-verbose 10). This should show what's up. Present the Tramp debug buffer on the Tramp mailing list (stackexchange is not suited for this kind of analysis).


I've experienced the same issue and I was able to narrow it down to this code snippet defining dired-toggle-sudo that I have copied and pasted into my init.el.

;; dired-toggle-sudo
(use-package dired-toggle-sudo
  :ensure t
  (define-key dired-mode-map (kbd "C-c C-s") 'dired-toggle-sudo)
  (eval-after-load 'tramp
       ;; Allow to use: /sudo:user@host:/path/to/file
       (add-to-list 'tramp-default-proxies-alist
                    '(".*" "\\`.+\\'" "/ssh:%h:")))))

Can someone as @Michael Albinus suggest a workaround, as I would like to keep this dired-toggle-sudo functionality within emacs? I would note that I am using ssh-agent as well. Thanks in advance.

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.