Emacs Tramp在文件获取过程中卡在'Found remote shell prompt'上

时间:2016-06-01 14:57:30

标签: shell emacs freebsd tramp stty

我最近设置了一台新的FreeBSD机器,似乎无法通过Emacs Tramp连接。它一直停留在“Tramp:在'broken.example.com'上找到远程shell提示符”。 (主机名因匿名而更改)

我将调试调整为10,因为我看到建议并且它已经停留在此命令。

stty icanon erase ^H cols 32767

它在循环中不断执行此命令。完整的日志可以在http://depht.com/temp/emacs-tramp-broken.example.com.txt

下载 来自broken.example.com的

'stty -a'。

speed 9600 baud; 65 rows; 32767 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
    -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
    -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
    brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
    -dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^@; eof = ^D; eol = <undef>;
    eol2 = <undef>; erase = ^H; erase2 = ^T; intr = ^C; kill = ^U;
    lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
    status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;

我有一台稍微旧的OpenBSD机器,这台Emacs Tramp客户端与working.example.com配合使用。与此计算机的连接日志位于http://depht.com/temp/emacs-tramp-working.example.com.txt

来自working.example.com的

'stty -a'

speed 9600 baud; 65 rows; 166 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
        -extproc -xcase
iflags: -istrip icrnl -inlcr -igncr -iuclc ixon -ixoff ixany imaxbel
        -ignbrk brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl -onocr -onlret -olcuc oxtabs -onoeot
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -mdmbuf
cchars: discard = ^O; dsusp = ^@; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^H; intr = ^C; kill = ^U; lnext = ^V;
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
        stop = ^S; susp = ^Z; time = 0; werase = ^W;

我已经破坏了broken.example.com上的stty设置来模仿working.example.com的设置,但没有成功。我真的不明白所有的stty设置。一个可能的攻击途径是'stty pendin',stty的手册页说的是icanon。但是,我无法在broken.example.com上设置-pendin。通过登录脚本执行'stty -pendin'或手动登录后不会导致'-pendin'设置。

此时我完全迷失了,任何帮助都会非常感激。提前谢谢!!

1 个答案:

答案 0 :(得分:2)

读取跟踪文件有几个问题。

  1. 您收到消息

    ControlPath "/var/folders/y8/zyh_szbx38s64w6_3_6nlhtm0000gp/T/tramp.5709SZd.smutt@broken.example.com:1345.RPyknjfNbHeeMjoQ" too long for Unix domain socket
    
  2. 可能,您的本地计算机运行OS X并且您已经陷入错误http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19702。这已经在Emacs 24.5中解决了(你应该运行24.4),而Tramp似乎并没有受到这种阻碍。

    1. Tramp远程发送命令stty icanon erase ^H cols 32767。命令本身不是问题,但是你的远程主机返回Tramp不理解的转义序列。当Tramp调用/bin/sh时,哪个shell是远程运行的?无论是什么,你必须禁用该shell的任何花哨装饰,如提示设置,屏幕清理等等。有关如何执行此操作的建议,请参阅Tramp手册。暂时禁用~/.profile的评估或初始化期间读取的shell。
相关问题