HOME / 日記 / ssh -Xでリモートログインしても、リモート先のXのアプリが起動しない場合

Date: 2011/11/27 |  このエントリーをはてなブックマークに追加  |  Tags: Solaris, xauth, ssh -X, できない

ssh -Xでリモートログインしても、リモート先のXのアプリが起動しない場合

あまりにも基礎的だけど、はまってた人がいたので。

  • 答え
    • xauthをインストールする。

これだとあまりにもなにもないので、調査報告とエラーログの見方も含め、Solarisの場合にて。まぁ他のUNIX系OSでもだいたい同じですが。

ssh -vXでログインしたとき、

うまくいかない例

ssh -vX solaris
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/kohju/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to solaris [192.168.10.1] port 22.
debug1: Connection established.
debug1: identity file /Users/kohju/.ssh/id_rsa type 1
debug1: identity file /Users/kohju/.ssh/id_rsa-cert type -1
debug1: identity file /Users/kohju/.ssh/id_dsa type 2
debug1: identity file /Users/kohju/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version Sun_SSH_2.0
debug1: no match: Sun_SSH_2.0
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'solaris' is known and matches the RSA host key.
debug1: Found key in /Users/kohju/.ssh/known_hosts:321
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/kohju/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 149
debug1: Authentication succeeded (publickey).
Authenticated to solaris ([192.168.10.1]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LANG = ja_JP.UTF-8
debug1: Sending env LC_ALL = ja_JP.UTF-8
debug1: Remote: No xauth program; cannot forward with spoofing.
debug1: Remote: Channel 0 set: LANG=ja_JP.UTF-8
debug1: Remote: Channel 0 set: LC_ALL=ja_JP.UTF-8
Last login: Sun Nov 27 21:37:19 2011 from 192.168.10.37
Oracle Corporation      SunOS 5.11      11.0    November 2011

このなかで、下記のようなエラーが出るときは、ssh -Xができない。

debug1: Remote: No xauth program; cannot forward with spoofing.

これはxauthというプログラムがないときに出てくる。見逃していた人は、ちゃんとこう言うログを1つづつ確認する癖はつけましょう :)

xauthさえわかったら、パッケージの検索。Solaris 11はリモートのファイルの構成要素があるので、簡単なのがいい。

pkg search -r xauth
INDEX           ACTION VALUE                                                                                                           PACKAGE
basename        file   usr/bin/xauth                                                                                                   pkg:/x11/session/xauth@1.0.6-0.175.0.0.0.0.1215
basename        link   usr/X11/bin/xauth                                                                                               pkg:/x11/session/xauth@1.0.6-0.175.0.0.0.0.1215
pkg.description set    The xauth program is used to edit and display the authorization information used in connecting to the X server. pkg:/x11/session/xauth@1.0.6-0.175.0.0.0.0.1215
pkg.fmri        set    solaris/x11/session/xauth                                                                                       pkg:/x11/session/xauth@1.0.6-0.175.0.0.0.0.1215
pkg.summary     set    xauth - X authority file utility                                                                                pkg:/x11/session/xauth@1.0.6-0.175.0.0.0.0.1215

pkg searchはあらゆるものを検索するので、あらゆるINDEX名(basename、pkg.descriptionなどなど)がでてくる。今回はファイルとして/usr/bin/xauthがあるものを見つければいいので、パッケージ名は、pkg:/x11/session/xauthということがわかる。

インストールする。

sudo pkg install pkg:/x11/session/xauth                         

再度ログインすれば、xeyeでもxtermでも何でも起動ができるはず。

問題解決は最もシンプルなアプリをインストールするところからしましょう :)


日記

Recent Updates