19

I think this is very basic question in using tramp, but it doesn't work for me. I have my ~/.ssh/config file that points to my amazon ec2 machine

Host amazon
   Hostname xxxx.amazonaws.com
   Port yyy
   User me
   IdentityFile ~/.ssh/ubuntu
   ForwardAgent yes

I can easily do ssh amazon from my terminal and I go to amazon ec2 (so my config is right), but in emacs I do:

C-x C-f /ssh1:amazon:

I always get this error In Aquamacs:

Process *tramp/ssh1 amz* exited abnormally with code 255

In Emacs:

tramp: Opening connection at amz using ssh1...
tramp: Waiting for prompts from remote shell
tramp: Waiting 60s for prompt from remote shell
tramp-process-actions: Login failed

I also have other ssh configurations that they ssh to my virtual boxes on my local machine and they have the same problem.

I really appreciate any help.

Matilda
  • 1,708
  • 3
  • 25
  • 33

3 Answers3

46

One thing that's worth trying is using the sshx connection method. That makes tramp try to avoid any non-standard shell configuration on the remote host.

Like this:

C-x C-f /sshx:amazon:
legoscia
  • 39,593
  • 22
  • 116
  • 167
10

The tramp method ssh1 forces ssh to be run in ssh v1 protocol mode with the parameter -1. ssh v1 has known weaknesses and is insecure. Hence a lot of sites disable the ssh v1 protocol.

You can verify this from the shell with ssh -1 me@xxxx.amazonaws.com.

Try other tramp connection methods like ssh, sftp or scpx. You can see all pre-configured connection methods with C-h v tramp-methods.

phils
  • 71,335
  • 11
  • 153
  • 198
Moritz Bunkus
  • 11,592
  • 3
  • 37
  • 49
  • Thanks you where right amazon doesn't accept ssh -1, but it does accept ssh -2, and I still have the same problem. At least now I'm not doing ssh1 :) – Matilda Mar 28 '12 at 16:59
6

If Moritz Bunkus's answer doesn't solve the issue, then you can configure the verbosity of tramp's output with
M-x customize-variable RET tramp-verbose RET

In particular, level 6 is "sent and received strings" which might help you to determine whether the "Waiting for prompts from remote shell" is because it isn't receiving a prompt pattern that it recognises, or because of some more critical failure.

If it's simply receiving a prompt it doesn't recognise, then you might look at customizing the tramp-login-prompt-regexp or tramp-shell-prompt-pattern variables.

(Of course if your ssh agent is working correctly, then login prompts shouldn't be relevant.)

If you're running Emacs in Windows, then also see these Q&As:

Community
  • 1
  • 1
phils
  • 71,335
  • 11
  • 153
  • 198
  • so looks like the tramp verbose level is 9 on my emacs so it's pretty high. I run it with ssh2 and I get Loading tramp...done tramp: Opening connection at ssh2 using nil... tramp: Waiting for prompts from remote shell tramp: Waiting 60s for prompt from remote shell tramp-process-actions: Login failed hmm any other ideas? – Matilda Mar 28 '12 at 17:11
  • 1
    If the remote prompt cannot be found then I've often had issues with the type of shell run on the other hand. As far as I know tramp always executes commands with the remote shell being `/bin/sh`. Now `/bin/sh` can be a symlink to almost any POSIX-compatible shell, and current Debian/Ubuntu based distros often use `dash` instead of `bash`. Also `zsh` and `bash` are known to make problems if you use fancy prompts. My advice: 1. If `/bin/sh` is a symlink to `dash` then try changing that to `bash`. 2. If the `TERM` variable equals `dumb` then do not set a fancy prompt in your RC files. – Moritz Bunkus Mar 29 '12 at 19:17