在Emacs25中,我使用推荐的语法在sudo模式下打开一个远程文件:
find-file "/ssh:ichiban@izu|sudo:ichiban@izu:~/
但是Emacs只是挂了。我在.emacs文件中设置了一些去除设置:
(require 'tramp)
;(setq tramp-debug-buffer t)
(setq tramp-verbose 10)
; to enable tracing in tramp
(require 'trace)
(dolist (elt (all-completions "tramp-" obarray 'functionp))
(trace-function-background (intern elt)))
(untrace-function 'tramp-read-passwd)
(untrace-function 'tramp-gw-basic-authentication)
但结果信息无济于事。
要查看该信息,我从终端启动Emacs,然后在终端挂起时从终端发送一个Ctrl-c(不返回) - 然后我就可以读取调试数据了。
没有sudo模式,它可以正常工作:
find-file "/ssh:ichiban@izu:~/
我希望了解有关Emacs正在使用的协议的更多详细信息,并了解如何调整该协议 - 任何想法都会受到赞赏。
这是" sudo"的调试输出。和"非sudo"案件不同:
失败: sudo案例 / ssh:ichiban @izu | sudo:ichiban @ izu:/ home / ichiban
15:12:54.224210 tramp-maybe-open-connection (3) # Opening connection for ichiban@izu using sudo...
15:12:54.240334 tramp-get-local-locale (7) # locale en_US.utf8
15:12:54.240731 tramp-compute-multi-hops (5) # Add proxy ("izu" "ichiban" "/ssh:ichiban@izu:")
15:13:08.214197 tramp-maybe-open-connection (3) # Opening connection for ichiban@izu using sudo...failed
成功:非sudo案例 / ssh:ichiban @ izu:/ home / ichiban
15:02:58.629883 tramp-maybe-open-connection (3) # Opening connection for ichiban@izu using ssh...
15:02:58.647868 tramp-get-local-locale (7) # locale en_US.utf8
15:02:58.648444 tramp-get-connection-property (7) # login-args undef
15:02:58.648777 tramp-get-connection-property (7) # login-args undef
15:02:58.649111 tramp-call-process (6) # ‘ssh -o ControlMaster’ nil *temp*
15:02:58.651325 tramp-call-process (6) # 255
command-line line 0: missing argument.
15:02:58.651640 tramp-call-process (6) # ‘ssh -o ControlPath=%C 0.0.0.1’ nil *temp*
15:02:58.655076 tramp-call-process (6) # 255
Pseudo-terminal will not be allocated because stdin is not a terminal.
答案 0 :(得分:1)
find-file "/ssh:ichiban@izu|sudo:ichiban@izu:~/
你几乎肯定想要使用:
find-file "/ssh:ichiban@izu|sudo:root@izu:~/
或等效(因为root是此方法的默认用户)和更短的:
find-file "/ssh:ichiban@izu|sudo:izu:~/
我会冒险猜测Emacs正在挂起因为tramp处于无限循环中试图解析你给它的代理 - 你告诉它在访问时使用代理/ssh:ichiban@izu:
文件为ichiban@izu
!
请M-x report-emacs-bug
建议添加一些循环检测以防止这种情况发生。