* edit a file over two linked ssh
@ 2011-11-20 8:10 mehran khajavi
2011-11-20 9:20 ` Peter Dyballa
2011-11-20 11:14 ` Michael Albinus
0 siblings, 2 replies; 10+ messages in thread
From: mehran khajavi @ 2011-11-20 8:10 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 441 bytes --]
Hello,
I have a question:
How can I open a file in these steps:
1.open an Emacs on my client(desktop)
2.connect to my server by Emacs with ssh
3.connect to my second server with ssh
4.open the file in the second server
the problem is that I can not connect from the first server to second
server over ssh by Emacs
this command in the find file doesn't work:
Find file : /scpc:root@myfirstserver:scpc:root@mysecondserver
/var/www/myfile.txt
[-- Attachment #2: Type: text/html, Size: 610 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-20 8:10 edit a file over two linked ssh mehran khajavi
@ 2011-11-20 9:20 ` Peter Dyballa
2011-11-20 11:14 ` Michael Albinus
1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2011-11-20 9:20 UTC (permalink / raw)
To: mehran khajavi; +Cc: help-gnu-emacs
Am 20.11.2011 um 09:10 schrieb mehran khajavi:
> How can I open a file in these steps:
The TRAMP documentation (C-h i m T R A M P RET) describes the multi-hop method.
BTW, why do you need to become root?
--
Greetings
Pete (:
_ / __ - -
_/ \__/_/ - -
(´`) (´`) - -
`´ `´
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-20 8:10 edit a file over two linked ssh mehran khajavi
2011-11-20 9:20 ` Peter Dyballa
@ 2011-11-20 11:14 ` Michael Albinus
2011-11-20 13:17 ` Philipp Haselwarter
2011-11-21 15:46 ` suvayu ali
1 sibling, 2 replies; 10+ messages in thread
From: Michael Albinus @ 2011-11-20 11:14 UTC (permalink / raw)
To: mehran khajavi; +Cc: help-gnu-emacs
mehran khajavi <sinoohe.mkh@gmail.com> writes:
> Hello,
Hi,
> I have a question:
> How can I open a file in these steps:
> 1.open an Emacs on my client(desktop)
> 2.connect to my server by Emacs with ssh
> 3.connect to my second server with ssh
> 4.open the file in the second server
>
> the problem is that I can not connect from the first server to second
> server over ssh by Emacs
> this command in the find file doesn't work:
> Find file :
> /scpc:root@myfirstserver:scpc:root@mysecondserver/var/www/myfile.txt
(add-to-list 'tramp-default-proxies-alist
'("mysecondserver" "root" "/ssh:root@myfirstserver:"))
Then you can open the file as "/ssh:root@mysecondserver:/var/www/myfile.txt".
Note, that the "scpc" method is not suited for multi-hops.
If you take the recent Tramp sources from its CVS repository, you could
use ad-hoc multi-hops:
"/ssh:root@myfirstserver|ssh:root@mysecondserver:/var/www/myfile.txt"
Best regards, Michael.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-20 11:14 ` Michael Albinus
@ 2011-11-20 13:17 ` Philipp Haselwarter
2011-11-20 13:30 ` Michael Albinus
2011-11-21 15:46 ` suvayu ali
1 sibling, 1 reply; 10+ messages in thread
From: Philipp Haselwarter @ 2011-11-20 13:17 UTC (permalink / raw)
To: help-gnu-emacs
On 2011-11-20 11:14 UT, Michael Albinus <michael.albinus@gmx.de> wrote:
---8<---[snipped 23 lines]---8<---
MA> If you take the recent Tramp sources from its CVS repository, you
MA> could use ad-hoc multi-hops:
MA> "/ssh:root@myfirstserver|ssh:root@mysecondserver:/var/www/myfile.txt"
MA> Best regards, Michael.
Neat! When's that getting merged into emacs?
--
Philipp Haselwarter
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-20 13:17 ` Philipp Haselwarter
@ 2011-11-20 13:30 ` Michael Albinus
0 siblings, 0 replies; 10+ messages in thread
From: Michael Albinus @ 2011-11-20 13:30 UTC (permalink / raw)
To: Philipp Haselwarter; +Cc: help-gnu-emacs
Philipp Haselwarter <philipp.haselwarter@gmx.de> writes:
> MA> If you take the recent Tramp sources from its CVS repository, you
> MA> could use ad-hoc multi-hops:
>
> MA> "/ssh:root@myfirstserver|ssh:root@mysecondserver:/var/www/myfile.txt"
>
> MA> Best regards, Michael.
>
> Neat! When's that getting merged into emacs?
Immediately after the release of Emacs 24.1. I expect it early next
year, but who knows ...
Best regards, Michael.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-20 11:14 ` Michael Albinus
2011-11-20 13:17 ` Philipp Haselwarter
@ 2011-11-21 15:46 ` suvayu ali
2011-11-21 19:32 ` Michael Albinus
1 sibling, 1 reply; 10+ messages in thread
From: suvayu ali @ 2011-11-21 15:46 UTC (permalink / raw)
To: Michael Albinus; +Cc: Emacs mailing list
Hi Michael,
On Sun, Nov 20, 2011 at 12:14, Michael Albinus <michael.albinus@gmx.de> wrote:
> mehran khajavi <sinoohe.mkh@gmail.com> writes:
>
>> Hello,
>
> Hi,
>
>> I have a question:
>> How can I open a file in these steps:
>> 1.open an Emacs on my client(desktop)
>> 2.connect to my server by Emacs with ssh
>> 3.connect to my second server with ssh
>> 4.open the file in the second server
>>
>> the problem is that I can not connect from the first server to second
>> server over ssh by Emacs
>> this command in the find file doesn't work:
>> Find file :
>> /scpc:root@myfirstserver:scpc:root@mysecondserver/var/www/myfile.txt
>
> (add-to-list 'tramp-default-proxies-alist
> '("mysecondserver" "root" "/ssh:root@myfirstserver:"))
>
> Then you can open the file as "/ssh:root@mysecondserver:/var/www/myfile.txt".
> Note, that the "scpc" method is not suited for multi-hops.
>
I have a similar but a more complicated situation. I have to connect to
a remote machine hidden behind two gateway machines. Is this possible
using multi-hop?
To illustrate with examples if the publicly accessible machine is
publichost, the internal gateway is intgw and the machine I want to
connect to is remotehost behind intgw, how do I achieve this with tramp?
I tried to set tramp-default-proxies-alist to something like this:
(("remotehost.\+" nil "/ssh:publichost:ssh:intgw:"))
But this doesn't seem to do anything. Any ideas?
PS: I use "remotehost.\+" because there are a number of remote machines
behind the internal gateway machine with a common leading part of the
name (e.g. remotehost1, remotehost2, ...)
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-21 15:46 ` suvayu ali
@ 2011-11-21 19:32 ` Michael Albinus
2011-11-21 23:03 ` suvayu ali
0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2011-11-21 19:32 UTC (permalink / raw)
To: suvayu ali; +Cc: Emacs mailing list
suvayu ali <fatkasuvayu+linux@gmail.com> writes:
> Hi Michael,
Hi,
> I have a similar but a more complicated situation. I have to connect to
> a remote machine hidden behind two gateway machines. Is this possible
> using multi-hop?
Yes.
> To illustrate with examples if the publicly accessible machine is
> publichost, the internal gateway is intgw and the machine I want to
> connect to is remotehost behind intgw, how do I achieve this with tramp?
>
> I tried to set tramp-default-proxies-alist to something like this:
>
> (("remotehost.\+" nil "/ssh:publichost:ssh:intgw:"))
>
> But this doesn't seem to do anything. Any ideas?
>
> PS: I use "remotehost.\+" because there are a number of remote machines
> behind the internal gateway machine with a common leading part of the
> name (e.g. remotehost1, remotehost2, ...)
You haven't said which user to apply on publichost and intgw. I assume
publicuser and intuser. Then you could do
(add-to-list 'tramp-default-proxies-alist
'("remotehost.\+" nil "/ssh:intuser@intgw:"))
(add-to-list 'tramp-default-proxies-alist
'("intgw" nil "/ssh:publicuser@publichost:"))
Note, that the order of both forms matters. Now you can open "C-x C-f
/remoteuser@remotehost1:/path/to/file".
If you want to apply the ad-hoc multi-hops from recent Tramp in the CVS
repository, you would apply "C-x C-f
/ssh:publicuser@publichost|ssh:intuser@intgw|remoteuser@remotehost1:/path/to/file".
Best regards, Michael.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-21 19:32 ` Michael Albinus
@ 2011-11-21 23:03 ` suvayu ali
2011-11-22 5:33 ` Michael Albinus
0 siblings, 1 reply; 10+ messages in thread
From: suvayu ali @ 2011-11-21 23:03 UTC (permalink / raw)
To: Michael Albinus; +Cc: Emacs mailing list
[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]
Hello Michael,
On Mon, Nov 21, 2011 at 20:32, Michael Albinus <michael.albinus@gmx.de> wrote:
> You haven't said which user to apply on publichost and intgw. I assume
> publicuser and intuser. Then you could do
>
Sorry forgot to mention that. I have all the ssh settings in my
~/.ssh/config and tramp-default-method is set to ssh. So always I
connect like this: "C-x C-f /remotehost:/path/to/file".
> (add-to-list 'tramp-default-proxies-alist
> '("remotehost.\+" nil "/ssh:intuser@intgw:"))
> (add-to-list 'tramp-default-proxies-alist
> '("intgw" nil "/ssh:publicuser@publichost:"))
>
> Note, that the order of both forms matters. Now you can open "C-x C-f
> /remoteuser@remotehost1:/path/to/file".
This doesn't seem to work. Whenever I do this, using ps I can see tramp
tries to connect like this: ssh -l user -e none remotehost. And
obviously the connection times out.
I tried the following in a minimal Emacs 24 session.
(require 'tramp)
(setq debug-on-quit t
tramp-default-method "ssh"
tramp-verbose 6)
(add-to-list 'tramp-default-proxies-alist
'("remotehost.\+" nil "/ssh:%u@intgw:"))
(add-to-list 'tramp-default-proxies-alist
'("intgw" nil "/ssh:%u@publichost:"))
Then I tried to open a file like this: C-x C-f /user@remotehost:~/ RET
After waiting for a while I hit C-g to generate a backtrace (attached).
PS: I also tried using 'user' instead of %u without success.
Thanks,
--
Suvayu
Open source is the future. It sets us free.
[-- Attachment #2: log.txt --]
[-- Type: text/plain, Size: 15223 bytes --]
Debugger entered--Lisp error: (quit)
accept-process-output(#<process *tramp/ssh user@remotehost*> 1 nil)
byte-code("\305\b\206\x06\0\306\307\310#\211\x19\nB\x1a\311\216\312\v\b\f#+\207" [timeout -with-timeout-timer- with-timeout-timers proc timeout-msecs run-with-timer 1 nil #[nil "\300\301\211\"\207" [throw timeout] 3] ((cancel-timer -with-timeout-timer-)) accept-process-output] 5)
tramp-accept-process-output(#<process *tramp/ssh user@remotehost*> 1)
tramp-process-one-action(#<process *tramp/ssh user@remotehost*> ["ssh" "user" "remotehost" "~/"] ((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) (tramp-yn-prompt-regexp tramp-action-yn) (tramp-terminal-prompt-regexp tramp-action-terminal) (tramp-process-alive-regexp tramp-action-process-alive)))
byte-code("\306\b\307\310#\211\x19\nB\x1a\311\216\312\v\f\r#+\207" [timeout -with-timeout-timer- with-timeout-timers proc vec actions run-with-timer nil #[nil "\300\301\211\"\207" [throw timeout] 3] ((cancel-timer -with-timeout-timer-)) tramp-process-one-action] 5)
byte-code("\b\203\x12\0\305\306\215\211\x19\305=?\205\x10\0 )\207\307\n\v\f#\207" [timeout -with-timeout-value- proc vec actions timeout (byte-code "\306\b\307\310#\211\x19\nB\x1a\311\216\312\v\f\r#+\207" [timeout -with-timeout-timer- with-timeout-timers proc vec actions run-with-timer nil #[nil "\300\301\211\"\207" [throw timeout] 3] ((cancel-timer -with-timeout-timer-)) tramp-process-one-action] 5) tramp-process-one-action] 5)
tramp-process-actions(#<process *tramp/ssh user@remotehost*> ["ssh" "user" "remotehost" "~/"] 1 ((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) (tramp-yn-prompt-regexp tramp-action-yn) (tramp-terminal-prompt-regexp tramp-action-terminal) (tramp-process-alive-regexp tramp-action-process-alive)) 60)
byte-code("\306\b!\307\b\310\311#\312 !r\313\b!q\210`)\x1a\x19^[\x1c\311\314\315\217\210\f\205+\0\316\f!\205+\0\317\f!\320>?\205\324\x03\321\b!\210\311\211\x1d\x1e@\b\322\323\324\325\b!G!\203P\0\326\327\330\b!\331\b!#\202\\\0\326\332\325\b!\330\b!\331\b!$C\x1eA\x1eB\x1eC\x1eD\311\333\334\217,\210\x0eE\203~\0\322\x0eF\322^X\203~\0\311\335\336\217\210\337\216\x0eE\205\207\0\r?\x1eE\f\203\227\0\316\f!\203\227\0\340\f!\210\341\342\x0eG\"\210\341\343\344\"\210\341\345!\210\341\346\x0eH\"\210\347\b!\x1eI\x0eJ\x1eK\311\211\x1eL\x1eM\350\351!\203\306\0\351J\202;\x01\352\353!\203\335\0\354\353!\204\330\0\355\353!\205;\x01\353 \202;\x01\356\357!\211\x1eN\205\352\0\360\x0eN!)\203\366\0\361\356\357!!\202;\x01\356\362!\211\x1eN\205\x03\x01\360\x0eN!)\203\x0f\x01\361\356\362!!\202;\x01\356\363!\211\x1eN\205\x1c\x01\360\x0eN!)\203(\x01\361\356\363!!\202;\x01\364\365!\2034\x01\361\365!\202;\x01\366\367!\210\361\370!\x1eO\371\372\373\b!\313\b!\x0eP\203R\x01\x0eQ\x0ePD\202U\x01\x0eQC$)\x1c\374\f\375\b#\210\376\f\377\"\210\201i\0\f\311\"\210\b\201j\0\201k\0\201l\0\201m\0\201n\0\f!\201o\0#C\x1eA\x1eB\x1eC\x1eD\311\333\334\217,\210\201p\0\f\201q\0\201r\0\x0eQ$\210\x0eI\203\314\x03\x0eI@\x1eR\331\x0eR!\x1eS\325\x0eR!\x1eT\330\x0eR!\x1eU\311\x1eV\201s\0\x0eS\201t\0\"\x1eW\201s\0\x0eS\201u\0\"\x1eX\201s\0\x0eS\201v\0\"\x1eY\201s\0\x0eS\201w\0\"\x1eZ\201x\0\x0eR\201y\0\201z\0\311$\211\x1e[\205\377\x01\331\x0e[!\x1e\\\x0e[\205\n\x02\325\x0e[!\x1e]\x0e[\205\x17\x02\201{\0\x0e[!\x1e^\x0eW\x1e_\374\f\201|\0\201}\0\201~\0\x0e`\350\351!\2035\x02\351J\202\252\x02\352\353!\203L\x02\354\353!\204G\x02\355\353!\205\252\x02\353 \202\252\x02\356\357!\211\x1eN\205Y\x02\360\x0eN!)\203e\x02\361\356\357!!\202\252\x02\356\362!\211\x1eN\205r\x02\360\x0eN!)\203~\x02\361\356\362!!\202\252\x02\356\363!\211\x1eN\205\213\x02\360\x0eN!)\203\227\x02\361\356\363!!\202\252\x02\364\365!\203\243\x02\361\365!\202\252\x02\366\367!\210\361\370!\"!#\x1ea\311\x1eb\v\203\305\x02\x0eY\203\305\x02\201\x7f\0\x0eY\x0eX\"\x16X\x0e[\203\331\x02\x0eZ\203\331\x02\201\x7f\0\x0eZ\x0eX\"\x16X\201\200\0\x0ec\x0eU\"\203\372\x02\201\201\0\201\202\0\x0eU\"\x16V\201\201\0\201\203\0\x0eU\"\x16U\x0e\\\206\x01\x03\x0eS\x16d\x0e]\206\n\x03\x0eT\x16e\x0e^\206\x13\x03\x0eU\x16f\x0eU\206\x1d\x03\201y\0\x16U\x0eT\206'\x03\201y\0\x16T\x0eV\2061\x03\201y\0\x16V\201\204\0\201\205\0\x0eU\201\206\0\x0eT\201\207\0\x0eV\201\210\0\x0ea&\b\x16b\x0eg\201\211\0>?\205[\x03\201\212\0\x0e_\201o\0\201l\0\201\213\0\x0eX\201o\0#\x0eg\201\214\0>\205x\x03\201\215\0\260\x05\x16_\b\322\201\216\0\x0e_C\x1eA\x1eB\x1eC\x1eD\311\333\334\217,\210\201\217\0\b\x0e_\201\220\0\211$\210\201\221\0\f\b\n\x0eh\201q\0%\210\b\322\201\222\0\x0eUC\x1eA\x1eB\x1eC\x1eD\311\333\334\217,\210.\x10\x0eIA\211\x16I\204\242\x01\201\223\0\f\b\". ,\207" [vec process-environment pos process-name p tm tramp-get-connection-process tramp-get-connection-property "process-name" nil copy-sequence tramp-get-connection-buffer (byte-code "\306\307 \310\b\311\312#\"\313V\203g\0\b\203g\0\314\b!\203g\0\315\b!\316>\203g\0\317 \320\321\211$\210\315\b!\322>\2036\0\323\b\324\"\204g\0 \325\326\327\x1a^[\x1c\x1d\327\x1e \r\330\331\332\f\211\333N\334\335\v\n#E!C\x1a^[\x1e!\x1d\327\336\337\217,\210\304\f\334\335\v\n#C\"-\210\327\207" [p vec args fmt-string signal vec-or-proc tramp-time-diff current-time tramp-get-connection-property "last-cmd-time" (0 0 0) 60 processp process-status (run open) tramp-send-command "echo are you awake" t (run open) tramp-wait-for-output 10 file-error "Awake did fail" nil 1 "%s" error-message-string error-message apply format (byte-code "\b X\205}\0\306 \x1a\307\216\v\203;\0\b\310X\203;\0\311\312\b\313U\203!\0\314\2026\0\b\315U\203+\0\314\2026\0\b\316U\2035\0\317\2026\0\320\fP\r#\210 \321Y\205|\0\x0e\x1a\203d\0\322\x0e\x1a!\203d\0\323\324\x0e\x1a!!\203d\0r\324\x0e\x1a!q\210\325\x0e^[!\x16\x1a)\x0e\x1a\205|\0\326\x0e\x1a!\205|\0\311\327\x0e\x1a\330\331\b\"\fP\r$*\207" [level tramp-verbose save-match-data-internal tramp-message-show-message fmt-string args match-data ((byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) 3 apply message 0 "" 1 2 "Warning: " "Tramp: " 4 processp buffer-name process-buffer tramp-dissect-file-name vectorp tramp-debug-message format "(%d) # " vec-or-proc default-directory] 6) ((error)) tramp-message-show-message level] 10) ((file-error (byte-code "\302\b!\210\302 !\210\303 !\210\304\211\x11\207" [vec p tramp-flush-connection-property delete-process nil] 3))) processp process-status (run open) tramp-get-buffer 3 "%s..." zerop tramp-file-name-user format "Opening connection for %s using %s" tramp-file-name-host tramp-file-name-method "Opening connection for %s@%s using %s" (byte-code "\b X\205}\0\306 \x1a\307\216\v\203;\0\b\310X\203;\0\311\312\b\313U\203!\0\314\2026\0\b\315U\203+\0\314\2026\0\b\316U\2035\0\317\2026\0\320\fP\r#\210 \321Y\205|\0\x0e\x1a\203d\0\322\x0e\x1a!\203d\0\323\324\x0e\x1a!!\203d\0r\324\x0e\x1a!q\210\325\x0e^[!\x16\x1a)\x0e\x1a\205|\0\326\x0e\x1a!\205|\0\311\327\x0e\x1a\330\331\b\"\fP\r$*\207" [level tramp-verbose save-match-data-internal tramp-message-show-message fmt-string args match-data ((byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) 3 apply message 0 "" 1 2 "Warning: " "Tramp: " 4 processp buffer-name process-buffer tramp-dissect-file-name vectorp tramp-debug-message format "(%d) # " vec-or-proc default-directory] 6) ((error)) (byte-code "\303\304!\204\f\0\305\304!\205/\0\304\306\307\b!G!\203\"\0\310\311\312\b!\313\b!#\202.\0\310\314\307\b!\312\b!\313\b!$!\211\x11\205:\0\315\316\317\320 $\x12\303\207" [vec pr tm subrp make-progress-reporter functionp zerop tramp-file-name-user format "Opening connection for %s using %s" tramp-file-name-host tramp-file-name-method "Opening connection for %s@%s using %s" run-at-time 3 0.1 tramp-progress-reporter-update] 8) ((error)) ((byte-code "\b\203\x14\0\306\307!\204\x10\0\310\307!\203\x14\0\307\b!\210 \311\312\313\314 !G!\203,\0\315\316\317 !\320 !#\2028\0\315\321\314 !\317 !\320 !$C\x1a^[\x1c\x1d\322\323\324\217,\207" [tm vec args fmt-string level vec-or-proc subrp cancel-timer functionp 3 "%s...done" zerop tramp-file-name-user format "Opening connection for %s using %s" tramp-file-name-host tramp-file-name-method "Opening connection for %s@%s using %s" nil (byte-code "\b X\205}\0\306 \x1a\307\216\v\203;\0\b\310X\203;\0\311\312\b\313U\203!\0\314\2026\0\b\315U\203+\0\314\2026\0\b\316U\2035\0\317\2026\0\320\fP\r#\210 \321Y\205|\0\x0e\x1a\203d\0\322\x0e\x1a!\203d\0\323\324\x0e\x1a!!\203d\0r\324\x0e\x1a!q\210\325\x0e^[!\x16\x1a)\x0e\x1a\205|\0\326\x0e\x1a!\205|\0\311\327\x0e\x1a\330\331\b\"\fP\r$*\207" [level tramp-verbose save-match-data-internal tramp-message-show-message fmt-string args match-data ((byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) 3 apply message 0 "" 1 2 "Warning: " "Tramp: " 4 processp buffer-name process-buffer tramp-dissect-file-name vectorp tramp-debug-message format "(%d) # " vec-or-proc default-directory] 6) ((error))] 9)) delete-process setenv "TERM" "LC_ALL" "C" "PROMPT_COMMAND" "PS1" tramp-compute-multi-hops boundp temporary-file-directory fboundp temp-directory subrp functionp getenv "TEMP" file-directory-p file-name-as-directory ...] 10)
tramp-maybe-open-connection(["ssh" "user" "remotehost" "~/"])
tramp-send-command(["ssh" "user" "remotehost" "~/"] "cd ~; pwd")
tramp-sh-handle-expand-file-name("/user@remotehost:~/" nil)
apply(tramp-sh-handle-expand-file-name ("/user@remotehost:~/" nil))
tramp-sh-file-name-handler(expand-file-name "/user@remotehost:~/" nil)
apply(tramp-sh-file-name-handler expand-file-name ("/user@remotehost:~/" nil))
byte-code("\bK\211\x19<\203\226\0 @\306=\203\226\0\307\310!\203\x1a\0\310J\202\211\0\311\312!\2031\0\313\312!\204,\0\314\312!\205\211\0\312 \202\211\0\315\316!\211\x1a\205<\0\317\n!)\203H\0\320\315\316!!\202\211\0\315\321!\211\x1a\205S\0\317\n!)\203_\0\320\315\321!!\202\211\0\315\322!\211\x1a\205j\0\317\n!)\203v\0\320\315\322!!\202\211\0\323\324!\203\202\0\320\324!\202\211\0\325\326!\210\320\327!^[\330 \211\x1cA@)\331\332#\210)\333\b\r\x0e\x1c#)\207" [foreign sf d default-directory x operation autoload boundp temporary-file-directory fboundp temp-directory subrp functionp getenv "TEMP" file-directory-p file-name-as-directory "TMP" "TMPDIR" file-exists-p "c:/temp" message "Neither `temporary-file-directory' nor `temp-directory' is defined -- using /tmp." "/tmp" load noerror nomessage apply args] 5)
tramp-file-name-handler(expand-file-name "/user@remotehost:~/" nil)
file-exists-p("/user@remotehost:~/")
#[0 "\302\304=\203\b\0\305\207\302\242\306=\203!\0\307\300!G\310\311\302A\"\306\x02\300G^\x02BB\207\302\312=\2037\0\313\300G!?\205\240\0\301\2064\0\314\300!\207\315\300!\307\300!\211\206B\0\v\302\204\\\0\316\x03\x02\301#\211;\203V\0\x02\x01P\202W\0\211\262\x01\202\236\0\302\317=\205\236\0\320\x03\x02\"\301\321>\204\233\0\322\301\323=\203w\0\324\202x\0\301\325\x04!^[\x02\211\203\225\0\211@\x02\x01!\203\216\0\211\x04B\262\x04\x01A\266\202\202}\0\210)\x01\237\266\203\211\262\x01\266\203\207" ["/user@remotehost:~/" file-exists-p lambda default-directory metadata (metadata (category . file)) boundaries file-name-directory string-match-p "/" lambda zerop file-exists-p file-name-nondirectory file-name-completion t file-name-all-completions (nil file-exists-p) nil file-directory-p #[257 "\211G\211\300V\205\x0e\0\x01\x01SH\301=\207" [0 47] 4 "\n\n(fn S)"] expand-file-name] 10 "\n\n(fn)"]()
funcall(#[0 "\302\304=\203\b\0\305\207\302\242\306=\203!\0\307\300!G\310\311\302A\"\306\x02\300G^\x02BB\207\302\312=\2037\0\313\300G!?\205\240\0\301\2064\0\314\300!\207\315\300!\307\300!\211\206B\0\v\302\204\\\0\316\x03\x02\301#\211;\203V\0\x02\x01P\202W\0\211\262\x01\202\236\0\302\317=\205\236\0\320\x03\x02\"\301\321>\204\233\0\322\301\323=\203w\0\324\202x\0\301\325\x04!^[\x02\211\203\225\0\211@\x02\x01!\203\216\0\211\x04B\262\x04\x01A\266\202\202}\0\210)\x01\237\266\203\211\262\x01\266\203\207" ["/user@remotehost:~/" file-exists-p lambda default-directory metadata (metadata (category . file)) boundaries file-name-directory string-match-p "/" lambda zerop file-exists-p file-name-nondirectory file-name-completion t file-name-all-completions (nil file-exists-p) nil file-directory-p #[257 "\211G\211\300V\205\x0e\0\x01\x01SH\301=\207" [0 47] 4 "\n\n(fn S)"] expand-file-name] 10 "\n\n(fn)"])
completion-file-name-table("/user@remotehost:~/" file-exists-p lambda)
completion--file-name-table("/user@remotehost:~/" file-exists-p lambda)
complete-with-action(lambda completion--file-name-table "/user@remotehost:~/" file-exists-p)
#[257 "\303\302\x02\300\301$\207" ["/user@remotehost:~/" file-exists-p lambda complete-with-action] 6 "\n\n(fn TABLE)"](completion--file-name-table)
#[0 "\302\300\301@\301\211@A\240\210@!\240\207" [#[257 "\303\302\x02\300\301$\207" ["/user@remotehost:~/" file-exists-p lambda complete-with-action] 6 "\n\n(fn TABLE)"] (nil) (nil)] 5 "\n\n(fn)"]()
funcall(#[0 "\302\300\301@\301\211@A\240\210@!\240\207" [#[257 "\303\302\x02\300\301$\207" ["/user@remotehost:~/" file-exists-p lambda complete-with-action] 6 "\n\n(fn TABLE)"] (nil) (nil)] 5 "\n\n(fn)"])
completion--some(#[257 "\303\302\x02\300\301$\207" ["/user@remotehost:~/" file-exists-p lambda complete-with-action] 6 "\n\n(fn TABLE)"] (completion--embedded-envvar-table completion--file-name-table))
read-file-name-internal("/user@remotehost:~/" file-exists-p lambda)
test-completion("/user@remotehost:~/" read-file-name-internal file-exists-p)
minibuffer-complete-and-exit()
call-interactively(minibuffer-complete-and-exit nil nil)
read-from-minibuffer("Find file: " "~/.emacs.d/" (keymap (keymap (32)) keymap (10 . minibuffer-complete-and-exit) (13 . minibuffer-complete-and-exit) keymap (menu-bar keymap (minibuf "Minibuf" keymap (tab menu-item "Complete" minibuffer-complete :help "Complete as far as possible") (space menu-item "Complete Word" minibuffer-complete-word :help "Complete at most one word") (63 menu-item "List Completions" minibuffer-completion-help :help "Display all possible completions") "Minibuf")) (27 keymap (118 . switch-to-completions)) (prior . switch-to-completions) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . minibuffer-complete) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the minibuffer") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuffer") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\r" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (up . previous-history-element) (prior . previous-history-element) (down . next-history-element) (next . next-history-element) (27 keymap (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil file-name-history "~/.emacs.d/" nil)
completing-read-default("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/.emacs.d/" file-name-history "~/.emacs.d/" nil)
completing-read("Find file: " read-file-name-internal file-exists-p confirm-after-completion "~/.emacs.d/" file-name-history "~/.emacs.d/")
read-file-name-default("Find file: " nil "~/.emacs.d/" confirm-after-completion nil nil)
read-file-name("Find file: " nil "~/.emacs.d/" confirm-after-completion)
find-file-read-args("Find file: " confirm-after-completion)
byte-code("\300\301\302 \"\207" [find-file-read-args "Find file: " confirm-nonexistent-file-or-buffer] 3)
call-interactively(find-file nil nil)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-21 23:03 ` suvayu ali
@ 2011-11-22 5:33 ` Michael Albinus
2011-11-22 12:53 ` suvayu ali
0 siblings, 1 reply; 10+ messages in thread
From: Michael Albinus @ 2011-11-22 5:33 UTC (permalink / raw)
To: suvayu ali; +Cc: Emacs mailing list
suvayu ali <fatkasuvayu+linux@gmail.com> writes:
> Hello Michael,
Hi,
> Sorry forgot to mention that. I have all the ssh settings in my
> ~/.ssh/config and tramp-default-method is set to ssh. So always I
> connect like this: "C-x C-f /remotehost:/path/to/file".
This helps you for the first hop, to publichost. For the next hop, you
should have set ~/.ssh/config on publichost. And the last hop needs a
proper setting of ~/.ssh/config on intgw.
>> (add-to-list 'tramp-default-proxies-alist
>> '("remotehost.\+" nil "/ssh:intuser@intgw:"))
>> (add-to-list 'tramp-default-proxies-alist
>> '("intgw" nil "/ssh:publicuser@publichost:"))
>>
>> Note, that the order of both forms matters. Now you can open "C-x C-f
>> /remoteuser@remotehost1:/path/to/file".
>
> This doesn't seem to work. Whenever I do this, using ps I can see tramp
> tries to connect like this: ssh -l user -e none remotehost. And
> obviously the connection times out.
>
> I tried the following in a minimal Emacs 24 session.
>
> (require 'tramp)
>
> (setq debug-on-quit t
> tramp-default-method "ssh"
> tramp-verbose 6)
>
> (add-to-list 'tramp-default-proxies-alist
> '("remotehost.\+" nil "/ssh:%u@intgw:"))
> (add-to-list 'tramp-default-proxies-alist
> '("intgw" nil "/ssh:%u@publichost:"))
>
> Then I tried to open a file like this: C-x C-f /user@remotehost:~/ RET
Is it the same user on all three hosts?
> After waiting for a while I hit C-g to generate a backtrace (attached).
Please send me the reulting debug buffer. Setting tramp-verbose to 9 or
10 might be better. And I would also like to see the value of
`tramp-default-proxies-alist'.
You can send it off the list.
> Thanks,
Best regards, Michael.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit a file over two linked ssh
2011-11-22 5:33 ` Michael Albinus
@ 2011-11-22 12:53 ` suvayu ali
0 siblings, 0 replies; 10+ messages in thread
From: suvayu ali @ 2011-11-22 12:53 UTC (permalink / raw)
To: Emacs mailing list
To update,
> (add-to-list 'tramp-default-proxies-alist
> '("remotehost.\+" nil "/ssh:%u@intgw:"))
> (add-to-list 'tramp-default-proxies-alist
> '("intgw" nil "/ssh:%u@publichost:"))
With help from Michael, the problem turned out to be a simple regexp
problem for the host name. "^remotehost" and "^intgw" worked
beautifully.
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-11-22 12:53 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-20 8:10 edit a file over two linked ssh mehran khajavi
2011-11-20 9:20 ` Peter Dyballa
2011-11-20 11:14 ` Michael Albinus
2011-11-20 13:17 ` Philipp Haselwarter
2011-11-20 13:30 ` Michael Albinus
2011-11-21 15:46 ` suvayu ali
2011-11-21 19:32 ` Michael Albinus
2011-11-21 23:03 ` suvayu ali
2011-11-22 5:33 ` Michael Albinus
2011-11-22 12:53 ` suvayu ali
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).