2

When I try to connect to my office computer with tramp: C-x f "/ssh:office:" it shows me the message: "Found remote shell prompt on" and then completely hangs. I have to terminate with C-g, if I hit enter the emacs session dies completely. Connecting with "ssh" works fine.

These are the complete error messages:

This is the debug tramp/ssh buffer:

atias-HP-ProDesk-600-G1-TWR ~ % 
10:28:01.900922 tramp-get-connection-property (7) # process-buffer nil
10:28:01.901918 tramp-process-actions (3) # Waiting for prompts from remote shell...done
10:28:01.904656 tramp-maybe-open-connection (3) # Found remote shell prompt on `office'
10:28:01.904954 tramp-get-connection-property (7) # remote-shell nil
10:28:01.905100 tramp-open-shell (5) # Opening remote shell `/bin/sh'...
10:28:01.905286 tramp-get-connection-property (7) # process-name nil
10:28:01.905420 tramp-get-connection-property (7) # remote-echo nil
10:28:01.905543 tramp-send-command (6) # exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 
10:28:01.905668 tramp-get-connection-property (7) # process-name nil
10:28:01.905795 tramp-get-connection-property (7) # chunksize nil
10:28:01.905910 tramp-set-connection-property (7) # last-cmd-time (22208 18593 905880 548000)
10:28:01.906046 tramp-send-string (10) # exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 
10:28:01.906184 tramp-get-connection-property (7) # process-buffer nil
10:28:01.906355 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.906491 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.906637 tramp-get-connection-property (7) # gateway nil
10:28:01.906849 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[K
10:28:01.907001 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.907118 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.907240 tramp-get-connection-property (7) # gateway nil
10:28:01.909402 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec
10:28:01.909563 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.909685 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.909798 tramp-get-connection-property (7) # gateway nil
10:28:01.909939 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/nul
10:28:01.910038 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.910128 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.910214 tramp-get-connection-property (7) # gateway nil
10:28:01.910807 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_CO
10:28:01.910964 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.911089 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.911213 tramp-get-connection-property (7) # gateway nil
10:28:01.911377 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /b
10:28:01.911480 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.911565 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.911645 tramp-get-connection-property (7) # gateway nil
10:28:01.911783 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 
10:28:01.911874 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.911942 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.912022 tramp-get-connection-property (7) # gateway nil
10:28:01.912143 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

10:28:01.912219 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.912287 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.912363 tramp-get-connection-property (7) # gateway nil
10:28:01.917431 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ 
10:28:01.918049 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.918349 tramp-get-connection-property (7) # check-remote-echo nil
10:28:01.918658 tramp-get-connection-property (7) # gateway nil
10:28:02.920243 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ 
10:28:02.920613 tramp-get-connection-property (7) # check-remote-echo nil
10:28:02.920815 tramp-get-connection-property (7) # check-remote-echo nil
10:28:02.921068 tramp-get-connection-property (7) # gateway nil
10:28:03.922505 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ 
10:28:03.922698 tramp-get-connection-property (7) # check-remote-echo nil
10:28:03.922803 tramp-get-connection-property (7) # check-remote-echo nil
10:28:03.922941 tramp-get-connection-property (7) # gateway nil
10:28:04.923560 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ 
10:28:04.923871 tramp-get-connection-property (7) # check-remote-echo nil
10:28:04.924050 tramp-get-connection-property (7) # check-remote-echo nil
10:28:04.924275 tramp-get-connection-property (7) # gateway nil
10:28:05.925124 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ 
10:28:05.925315 tramp-get-connection-property (7) # check-remote-echo nil
10:28:05.925409 tramp-get-connection-property (7) # check-remote-echo nil
10:28:05.925524 tramp-get-connection-property (7) # gateway nil
10:28:06.925941 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*
[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ 
10:28:06.926110 tramp-get-connection-property (7) # check-remote-echo nil
10:28:06.926198 tramp-get-connection-property (7) # check-remote-echo nil
10:28:06.926310 tramp-get-connection-property (7) # gateway nil
10:28:07.432947 tramp-open-shell (5) # Opening remote shell `/bin/sh'...failed
10:28:07.434672 tramp-maybe-open-connection (3) # Opening connection for matias@office using ssh...failed
10:28:07.435634 tramp-get-file-property (8) #  file-truename nil
10:28:07.436239 tramp-flush-directory-property (8) # 
10:28:07.436554 tramp-get-connection-property (7) # process-name nil
10:28:07.436781 tramp-get-connection-property (7) # process-name nil
10:28:07.437118 tramp-get-connection-property (7) # vector [ssh matias office  nil]
10:28:07.437291 tramp-process-sentinel (5) # Sentinel called: `#<process *tramp/ssh matias@office*>' `terminado (killed)
'
10:28:07.437433 tramp-flush-connection-property (7) # *tramp/ssh matias@office* (vector temp-file last-cmd-time)
10:28:07.437559 tramp-get-file-property (8) #  file-truename nil
10:28:07.437653 tramp-flush-directory-property (8) # 
10:28:07.440201 tramp-get-connection-property (7) # process-name nil
10:28:07.440410 tramp-flush-connection-property (7) # [ssh matias office nil nil] (first-password-request)
10:28:07.440555 tramp-get-connection-property (7) # process-buffer nil
10:28:07.440735 tramp-file-name-handler (1) # Interrupt received in operation (file-exists-p /ssh:matias@office:)

and

;; GNU Emacs: 24.5.1 Tramp: 2.2.11-24.5 -*- mode: outline; -*-
10:27:38.949023 tramp-check-proper-method-and-host (10) # 
  backtrace()
  tramp-error([#("ssh" 0 3 (tramp-default t)) nil "ssh" "matias" nil] user-error "Host name must not match method \"%s\"" "ssh")
  apply(tramp-error [#("ssh" 0 3 (tramp-default t)) nil "ssh" "matias" nil] user-error "Host name must not match method \"%s\"" "ssh")
  tramp-check-proper-method-and-host([#("ssh" 0 3 (tramp-default t)) nil "ssh" "matias" nil])
  tramp-maybe-open-connection([#("ssh" 0 3 (tramp-default t)) nil "ssh" "matias" nil])
  tramp-send-command([#("ssh" 0 3 (tramp-default t)) nil "ssh" "matias" nil] "cd ~; pwd")
  tramp-sh-handle-expand-file-name("/ssh:matias" nil)
  apply(tramp-sh-handle-expand-file-name ("/ssh:matias" nil))
  tramp-sh-file-name-handler(expand-file-name "/ssh:matias" nil)
  apply(tramp-sh-file-name-handler expand-file-name ("/ssh:matias" nil))
  byte-code("\300\301\215\207" [suppress (apply foreign operation args)] 2)
  byte-code("K\306\211<\203\237

1 Answer 1

1

According to the traces, Tramp sends the following command after it has connected the remote host:

exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh

The output is

[Keexec env ENV='' HISTFILE=/dev/null PROMP 
[KT
T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 

]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ 

Looks, like there are strange prompt settings. Check the Tramp manual for techniques how to suppress those settings.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.