1

I am working on a remote Linux machine a little complex right now. Firstly, I use Putty to login a jump machine which is also a Linux system in my office, then I use command go to jump to the remote machine outside of my office. There is also a key file I need when using putty. The Linux jump command is like this:

ssh 119.11.11.11 -p 22

The IP should be changed according to the remote machine IP.

The usual way of my development is always using Emacs Tramp to edit files remotely.

I don't want to copy my Emacs config files to the remote machine, for it is a little bit hard to sync the config files between machines. I also don't want to download the files to local for it isn't conveniently to debug.

In this suitation, how can I use Emacs to jump to the remote machine? Is it possible to do the jump by using Cygwin, Putty or something else?

My desktop is Windows 7, and my Emacs is 24.2

Watterry
  • 756
  • 9
  • 22
  • What does this `go` command do? – phils Feb 01 '13 at 02:00
  • What do you mean by "jump"? You have to decide on which machine you run Emacs. Either it's on the local Windows machine, in which case you can continue to use Tramp. Or it's on the remove, in which case you would have to copy the config files. Having said that, I have my Emacs config files in a version control system and it works like a charm to synchronize the changes between systems. – Lindydancer Feb 01 '13 at 06:39
  • You can configure Tramp to use a "proxy" (`119.11.11.11` in your case). See [this answer](http://stackoverflow.com/a/888572/113848) for an example of that. – legoscia Feb 01 '13 at 16:10

1 Answers1

2

Assuming you can't SSH directly to the destination server, it sounds like you could resolve this by configuring a multi-hop proxy for tramp.

I've only tried that once, but it was for a slightly different situation, and I had problems getting it working; so I'll just point you at the documentation, and leave it to someone more knowledgeable to provide other details if need be.

C-hig (tramp) Multi-hops RET

I would strongly recommend using either scpc or rsyncc as the method for the second hop, if possible, as that will automatically utilise SSH ControlMaster to keep the connection open, which dramatically improves Tramp performance.

I'm not sure whether or not there's an equivalent to that for PuTTY/plink? I do know that Cygwin isn't able to support ControlMaster for some technical reasons (or at least this was the case a few years ago), so using that probably wouldn't help.

Another alternative Cygwin's SSH and PuTTY is to host a Linux(*) VM on your Windows box and run Emacs inside that (which means you can use Linux's SSH and ControlMaster). Cygwin can provide an X display in that instance. That's complicating matters, of course, so I would certainly try out the simpler options first; but if performance is lacking, and your local PC is reasonably powerful, the VM approach might surprise you.

* or similar

Ignoring Tramp entirely, sshfs is often used to mount a remote filesystem locally, in which case Emacs doesn't even know that it's talking to a remote server. I've never used it myself, and certainly not on Windows, but it could be worth a look as well.

Community
  • 1
  • 1
phils
  • 71,335
  • 11
  • 153
  • 198