LoginSignup
19

More than 5 years have passed since last update.

X11Forwardingがうまくいかない場合の対処

Posted at

リモート側 (X client)

/etc/ssh/sshd_config の設定を変更

X11DisplayOffset 10
X11Forwarding yes
X11UseLocalhost no
XauthLocation /usr/bin/xauth

sshdを再起動

[remote-user@remote-host] $ sudo systemctl restart ssh

xauthが無い場合はインストール

[remote-user@remote-host] $ sudo apt-get install xauth

ローカル側 (X server)

X11Forwarding有効でリモート接続

[local-user@local-host] $ ssh -XY user@host

ssh接続の際にデバッグ情報を表示

[local-user@local-host] $ ssh -XYv user@host

Warning: No xauth data; using fake authentication data for X11 forwarding? が出る場合

認証情報を追加

[local-user@local-host] $ xauth generate $DISPLAY

確認

接続後xhostコマンドでリモート側でdisplayが見えるか確認
以下はうまくいっている例

[remote-user@remote-host] $ xhost
access control enabled, only authorized clients can connect
INET:localhost
INET:remote-host
INET:192.168.122.1
INET6:ip6-localhost
INET6:xxxx::xxxx:xxxx:xxxx:xxxx
LOCAL:

以下はうまくいっていない例

[remote-user@remote-host] $ xhost
xhost:  unable to open display ""

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
19