ssh 和窗口 ID
我在学校有一个项目要做,这让我感到困惑......我正在从我自己的 Debian 盒子通过 SSH 连接到计算机实验室中的 Solaris 计算机,
ssh -Y name@***.cs.<school>
我可以很好地进入,并且 X11 似乎也可以工作。 然而,这个特殊的项目要求我们通过 xwininfo 查找 netscape 窗口的窗口 id,并在以下命令中使用此信息。
netscape -id 0xa00029 -remote 'openFile(/path/to/html/file)'
现在,如果这个 netscape 是我打开的唯一窗口(xterm 除外),则前面的命令可以正常工作。 但是,如果我打开任何其他iceweasel窗口(无论我打开netscape/iceweasel的顺序如何),该命令都会转发到我的iceweasel,尽管我正在SSH会话中运行该命令并且
所有这些最终都必须进入 C 程序,但我什至无法让它手动可靠地工作!
有任何想法吗?
PS我刚刚看到这个可能有帮助。 当我使用相同的命令通过 Cygwin/X 进行 SSH 时,出现此错误
Warning: No xauth data; using fake authentication data for X11 forwarding.
不确定这是否重要,因为我仍然可以(显然)完美地使用 X11。
谢谢。
PPS -id 开关记录在 netscape 手册页中:
-id window-id
Identifies an X window to receive -remote commands. If
you do not specify a window, the first window found is
used.
I have a project to do in school which is baffeling me... I am SSHing into a Solaris computer in the computer lab from my own Debian box via
ssh -Y name@***.cs.<school>
I can get in just fine, and the X11 seems to be working also. However, this peticular project requires us to find the window id of a netscape window via xwininfo and use this information in the following command
netscape -id 0xa00029 -remote 'openFile(/path/to/html/file)'
Now, if this netscape is the only window I have open (other than xterm), the preceding command works just fine. However, if I have any other iceweasel windows open (regardless of the order in which I opened netscape/iceweasel) the command will forward to my iceweasel despite the facts that I'm running the command in my SSH session and the two windows have very different window ids.
All of this eventually has to go into a C program, but I can't even get it to work reliably manually!
Any ideas?
P.S. I just saw this that may help. When I SSHed via Cygwin/X using the same command, I get this error
Warning: No xauth data; using fake authentication data for X11 forwarding.
Not sure if this is important as I can still use X11 (aparently) perfectly.
Thanks.
P.P.S the -id switch is documented in the netscape man pages:
-id window-id
Identifies an X window to receive -remote commands. If
you do not specify a window, the first window found is
used.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您使用 ssh -Y 时,您请求将远程客户端转发到具有完全权限的本地 X 服务器。 Netscape/Mozilla/Firefox/Iceweasel/等。 远程协议通过X服务器运行,因此它也会被转发。
http://www.mozilla.org/unix/remote.html 记录协议,并且没有提及
-id
。 也没有快速查看源代码(例如 http://mxr.mozilla.org/seamonkey/source/widget/src/xremoteclient/XRemoteClient.cpp#202)看起来很有希望,因为有一个-id
选项。When you use ssh -Y, you're requesting that remote clients be forwarded to your local X server, with full permissions. The Netscape/Mozilla/Firefox/Iceweasel/Etc. remote protocol runs through the X server, so it'll be forwarded too.
http://www.mozilla.org/unix/remote.html documents the protocol, and mentions nothing about
-id
. Nor does a very quick look at the source (e.g., http://mxr.mozilla.org/seamonkey/source/widget/src/xremoteclient/XRemoteClient.cpp#202) look promising for there being an-id
option.我坐在一台实际的机器上执行相同的测试,它们也都失败了...我会打开 2 个 netscape 窗口,并尝试一次将命令定向到一个。 最近打开的一个可以正常工作,但是指向另一个的任何命令都会转发到同一窗口,因此此时我确信问题在于该命令未正确执行和/或该系统上的所有内容真的真的老了。
I sat down to an actual machine to perform the same tests, and they all fail there too... I would open 2 netscape windows and try to direct the command to one at a time. The most recently opened one would work properly, but any command directed to the other one would be forwarded to the same window, so at this point I am convinced that the problem lies in the command being not properly implemented and/or everything on that system being really, really old.
Iceweasel 就是这样编码的。 它尝试为该用户的所有打开的窗口仅运行一个进程。
使用 -no-remote 命令行选项来避免它。 请参阅http://kb.mozillazine.org/Command_line_arguments
Iceweasel is coded that way. It tries to have only a single process run for all open windows for that user.
Use the
-no-remote
command line option to avoid it. Seehttp://kb.mozillazine.org/Command_line_arguments