Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs 24.3.1 TRAMP hangs on opening file

Tags:

emacs

ssh

tramp

I am running graphical Emacs 24.3.1 (this problem exists when using the console version as well) on Arch Linux. I am trying to use TRAMP to open files on a remote Fedora system by SSH with a private key which requires a password. Authentication works fine, and so does the listing of files. When I do try to open a file, my Emacs session hangs with "Tramp: Inserting `/{filename I'm trying to open}' ...done". It is not possible to abort with ESC ESC ESC or C-g. Does anyone have a solution to this?

like image 797
justinpc Avatar asked Jul 11 '13 08:07

justinpc


2 Answers

Emacs 24 normally works very well with Tramp. What you might need is ControlMasterAuto in your .ssh/config file. This will ensure that the ssh connection information passes seamlessly to Emacs. This will also ensure that you only need to login once in a terminal and use multiple emacs frames in tramp mode. I have detailed the following steps

(1) Go to your .ssh/config file and add the following options

Host <hostname>
ControlMaster auto
ControlPath ~/.ssh/%r@%h:%p
ServerAliveCountMax=30
ServerAliveInterval=5

(2) Now login to the remote host through terminal.

(3) Open emacs frame and try opening the remote files through tramp (/ssh:). You must be able to connect to the remote host.

The above steps should work even for a two level authentication (using a rsa key +password).

like image 180
rambalachandran Avatar answered Oct 24 '22 02:10

rambalachandran


This thread is old - however, a very similar problem on my FC22 laptop (tramp hanging when trying to type a colon following /su in the minibuffer) appears to be fixed by commenting the ::1 line in /etc/hosts.

like image 1
Alien Life Form Avatar answered Oct 24 '22 02:10

Alien Life Form