首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试访问远程文件时Emacs Tramp的问题

尝试访问远程文件时Emacs Tramp的问题
EN

Stack Overflow用户
提问于 2018-02-22 21:02:48
回答 1查看 2K关注 0票数 2

在Emacs25中,我使用推荐的语法以sudo模式打开远程文件:

find-file "/ssh:ichiban@izu|sudo:ichiban@izu:~/

但Emacs就挂了。我在我的.emacs文件中设置了一些删除设置:

代码语言:javascript
复制
(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(没有返回)-然后我可以读取调试数据。

没有sudo模式,它工作得很好:

find-file "/ssh:ichiban@izu:~/

我希望看到更多关于Emacs正在使用的协议的详细信息,并学习如何调整该协议--,任何想法都将不胜感激。

这是"sudo“和"non”情况的调试输出不同的地方:

失败: /ssh:ichiban@izu|sudo:ichiban@izu:/home/ichiban sudo

代码语言:javascript
复制
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

non case /ssh:ichiban@izu:/home/ichiban

代码语言:javascript
复制
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.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-02-22 23:28:02

查找-file“/ssh:ichiban@izu:ichiban@izu:~/

你几乎肯定想用:

代码语言:javascript
复制
find-file "/ssh:ichiban@izu|sudo:root@izu:~/

或者等效地(因为root是此方法的默认用户)并且更短:

代码语言:javascript
复制
find-file "/ssh:ichiban@izu|sudo:izu:~/

我将冒险猜测Emacs挂起,因为tramp处于一个无限循环中,试图解析您给它的代理--您告诉它在以ichiban@izu的形式访问文件时使用代理ichiban@izu

M-x report-emacs-bug建议添加一些循环检测以防止这种情况发生。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48937101

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档