Emacs: Tramp not working

I tried to open the remote file via Emacs via Tramp.

(require 'tramp) (setq tramp-default-method "ssh") 

I get a message from Emacs

Tramp: waiting for requests from a remote shell

Emacs hung and did not respond to any actions after that

Emacs was installed on Windows; the remote file was on a Linux machine.

+35
ssh emacs tramp
Aug 05 2018-11-11T00:
source share
4 answers

If the account you are connecting to uses some kind of weird shell prompt, there’s a good chance that this is what makes the trip with a springboard.

Log in as root, then enter

 PS1="> " 

(which is the usual, standard shell (ZSH, BASH, younameit) hint that the tramp will understand) then switch to the user account and run emacs -q (to make sure your .emacs does not cause this mess) and try Cx Cf /sudo:root@localhost:/etc/hosts and see what.

You can (not recommended) also set up a regular expression that determines what strollers expect:

 Mx customize-variable RET tramp-terminal-prompt-regexp 

My approach:

  • Make sure the tramp-terminal-type variable is set to "dumb"

Mx customize-variable RET tramp-terminal-type

  1. Check what's in yours. * shrc and run the correct prompt:
 case "$TERM" in "dumb") PS1="> " ;; xterm*|rxvt*|eterm*|screen*) PS1="my fancy multi-line \n prompt > " ;; *) PS1="> " ;; esac 
+56
Dec 02 2018-11-28T00:
source share

Your ssh client for Windows is the key here, and the ssh 'Tramp method is almost certainly incorrect.

If you use Cygwin, you need to use the sshx method, and you probably will need to use ssh-agent for authentication. Details here: Is it possible to use tramp with EmacsW32 and cygwin?

I assume the same applies to any standalone ssh client that does not require a full installation of Cygwin, but uses the Cygwin DLLs. (I mention this because I'm sure I remember seeing it.)

If you use PuTTY, you need the plink method, as Alex Ott pointed out. If the Wiki is missing, search here will probably come up with solutions to customize this approach.

Other alternatives I can offer are as follows:

  • Use Cygwin-native Emacs. This will be slower than NTEmacs, but Tramp seems to work well with the ssh method and also works with passwords.

  • Install the Linux virtual machine in your Windows window and start Emacs. This is a pretty big hoop to go over, but it is my preferred way to use Tramp when running on Windows.

+17
Aug 05 '11 at 12:19
source share

Have you checked the Emacs wiki for a solution? Is ssh in PATH ? It is also recommended to use plink on MS Windows - see the "Built-in Methods" section in the Tramp documentation

+3
Aug 05 2018-11-11T00:
source share

By the way, if you need tramp to sudo - you can sudo without tramp to use sudoedit .

I am currently using this bash function:

 erf () { SUDO_EDITOR="emacsclient -a emacs" sudoedit $@; } 
0
01 Oct
source share



All Articles