snowmonkey
snowmonkey

Reputation: 287

emacs tramp double-hop ssh earlier solutions just dont work

Problem Statement:

Connect to machineB (jupiter) via [email protected]. My problem is closest to link 1 below. However, none of the info in the links make it work. To make the matters worse, emacs -debug-init produces no helpful info...atleast for an Emacs newbie such as myself.

One such debug info:

Debugger entered--Lisp error: (void-variable tramp-default-proxies-alist) add-to-list(tramp-default-proxies-alist ("\\'jupiter\\'" nil "/ssh:[email protected]:")) eval-buffer(# nil "/home/creta/.emacs.d/init.el" nil t) ; Reading at buffer position 159 load-with-code-conversion("/home/creta/.emacs.d/init.el" "/home/creta/.emacs.d/init.el" t t) load("/home/creta/.emacs.d/init" t t) #[0 "\205\262

Could the hyphen in the domain (uni-bonn) make a difference? I even tried with uni-bonn and other combinations but it doesn't make a difference.

I can use tramp to ssh to creta@recog.... by C-x C-f /ssh:[email protected]: RET PASSWORD...but later I do not know how to ssh further into jupiter which is my workstation.

I have followed the advice here:

Link 1: How can I use Emacs Tramp to double hop ssh?

Link 2: Open file via SSH and Sudo with Emacs

Link 3: Emacs Tramp ssh double hop

Link 4: http://comments.gmane.org/gmane.emacs.tramp/7578

Link 5: http://www.gnu.org/software/emacs/manual/html_node/tramp/Multi_002dhops.html

It would be great if this annoying thing gets solved.

Thanks a lot. Have a great day!

EDIT 1: I dont mind if I need to ssh twice (first into domain and then workstation) though I dont know if its a good idea. ability to work with files as if local in emacs (with its diredplus and other goodies) is a nice feature.

EDIT 2: I am using Emacs 24.2 on a Ubuntu machine (Natty 11.04 --> should update soon) if that helps.

Upvotes: 1

Views: 501

Answers (1)

The error message you mentioned is caused by TRAMP not being loaded before you try to configure it. Try using something like this:

(require 'tramp)
(add-to-list 'tramp-default-proxies-alist ...)

Or (better in terms of loading time, but more subject to tricky quoting-related bugs):

(eval-after-load "tramp"
   '(add-to-list 'tramp-default-proxies-alist ...))

Upvotes: 1

Related Questions