新城@筑波大学情報です。こんにちは。

In article <050629174253.M0102705@smr00.gssm.otsuka.tsukuba.ac.jp>
        ohki@gssm.otsuka.tsukuba.ac.jp (Atsuo Ohki) writes:
> >> ssh でリモートログインし
> >> ます。そこで、別の xterm や kterm を動かし、そこで文字を選択
> >> して、元の(sshのもの、本体は、Macで動いている)に文字をペース
> >> トしようとすると、新しくリモートで起動した方の xterm や 
> >> kterm が次のようなエラーで落ちます。
>  これって、 xtermやktermの問題ではなくて、ssh側の問題だと思います。
>  sshに「-Y」オプションを指定してみてください。

はい。ssh の問題でした。-Y オプションで解決しました。ありが
とうございました。これは、MacOSX 10.4 Tiger になって、ssh が
新しくなったということでしょうね。他の OS でもあり得るのでしょう。

------------------------------------------------------------
% man ssh
SSH(1)                    BSD General Commands Manual                   SSH(1)

NAME
     ssh -- OpenSSH SSH client (remote login program)
...
     -Y      Enables trusted X11 forwarding.
------------------------------------------------------------

man ssh_config の方を見ると、次のような説明がありました。

------------------------------------------------------------
SSH_CONFIG(5)               BSD File Formats Manual              SSH_CONFIG(5)

NAME
     ssh_config -- OpenSSH SSH client configuration files

SYNOPSIS
     $HOME/.ssh/config
     /etc/ssh_config
...
     ForwardX11
             Specifies whether X11 connections will be automatically redi-
             rected over the secure channel and DISPLAY set.  The argument
             must be ``yes'' or ``no''.  The default is ``no''.

             X11 forwarding should be enabled with caution.  Users with the
             ability to bypass file permissions on the remote host (for the
             user's X11 authorization database) can access the local X11 dis-
             play through the forwarded connection.  An attacker may then be
             able to perform activities such as keystroke monitoring if the
             ForwardX11Trusted option is also enabled.

     ForwardX11Trusted
             If the this option is set to ``yes'' then remote X11 clients will
             have full access to the original X11 display.  If this option is
             set to ``no'' then remote X11 clients will be considered
             untrusted and prevented from stealing or tampering with data
             belonging to trusted X11 clients.

             The default is ``no''.

             See the X11 SECURITY extension specification for full details on
             the restrictions imposed on untrusted clients.
------------------------------------------------------------

ssh -Y にしたり、~/.ssh/config に ForwardX11Trusted yes と書
くと、ssh の接続先で、キーボードのストロークが盗まれる危険性
が出てくるけど、no にしておけば、それは防がれるということです。
安全性は、 X11 authorization database の file permissions に
依存しています。つまり、次のファイルです。

------------------------------------------------------------
% ls -l ~/.Xauthority
-rw-------   1 yas         13410 Jun 30 23:09 /home/lab1/Sofl/yas/.Xauthority
% 
------------------------------------------------------------

このファイルが読まれると、X11 の MIT-MAGIC-COOKIE-1 が盗まれ
て、キーストロークを記録するようなプログラムが実行されると。
まあ、それはそうなんでしょうね。

接続先の sshd 自体がクラックされると、それはそれで終りという
話はあるので、接続先の root が安全と仮定するしかなくて、そう
いう前提では、 ~/.Xauthority のモードが 600 (rw-------)になっ
ていれば、まあ、-Y オプション(ForwardX11Trusted yes)にしても
いいのでしょう。

~/.ssh/config には、Host オプションがあるで、安全な所だけ
ForwardX11Trusted を yes にしてもいいでしょう。

In article <3992058news.pl@rananim.ie.u-ryukyu.ac.jp>
        kono@ie.u-ryukyu.ac.jp (Shinji KONO) writes:
> 河野真治 @ 琉球大学情報工学です。
> なんだろ〜 確か、X Widnow って漢字を単純にflat text として、
> cut & paste できないんです。なので、Compound object として
> 送るわけなんだよね。そのあたりで不整合になっているのかな。

前に、UTF で送受信しているらしいって、ここに書いていませんで
したっけ?

ssh が通信をブロックするのはいいけれど、クライアントをクラッ
シュさせるのは、やめて欲しいです。バグと言えばバグなんでしょ
う。クラッシュするのは、バッファ・オーバーフロー関係だったら
危ないんだけれと。大丈夫かなあ。

\\ 新城 靖 (しんじょう やすし) \\
\\ 筑波大学 電子・情報       \\