ssh xterm xsessionは機能しますが、他のプログラムエラー:認証エラーが原因でX11接続が拒否されました。

ssh xterm xsessionは機能しますが、他のプログラムエラー:認証エラーが原因でX11接続が拒否されました。

xterm、xclockなどが得られるようにxauthを設定しました。しかし、他のプログラム(gnome-terminal、ブラウザなど)はまだ認証できません。両方のコンピュータには、同じユーザー名とデフォルトのID 1000とグループ1000があります。

xauth部分がうまくいくと思っている間、xhost +クライアントでクイックテストを実行しました。結果は次のとおりです。

修正する必要があるエラーは次のとおりです。

client$ ssh -X server
...
server$ gnome-terminal
X11 connection rejected because of wrong authentication.
Error creating terminal: No screen 0 on display "localhost:10.0"

# But this works and shows the xterm window on the client.
$ xterm
# Pop!_OS ubuntu 21.10

client$ egrep X11 /etc/ssh/ssh_config
/etc/ssh/ssh_config:   ForwardX11 yes
/etc/ssh/ssh_config:#   ForwardX11Trusted yes

client$ xauth list
client/unix:  MIT-MAGIC-COOKIE-1  <<HEX SECRET A>>
#ffff#abcdef012345#:  MIT-MAGIC-COOKIE-1  <<HEX SECRET A>>

client$ echo $XAUTHORITY 
/run/user/1000/gdm/Xauthority

# There is no ~/.Xauthority
# Debian GNU/Linux 9 (stretch)

server$ egrep X11 /etc/ssh/sshd_config
/etc/ssh/sshd_config:X11Forwarding yes
/etc/ssh/sshd_config:#X11DisplayOffset 10
/etc/ssh/sshd_config:#X11UseLocalhost yes
/etc/ssh/sshd_config:#  X11Forwarding no

server$ echo $DISPLAY 
localhost:10.0

server$ xauth list
server/unix:10  MIT-MAGIC-COOKIE-1  <<HEX SECRET B>>

# ~/.Xauthority is 52 bytes and owned by 1000:1000

# On the server XAUTHORITY is not setup automatically. It does not
# matter if I `export XAUTHORITY=$HOME/.Xauthority` in the ssh session.

16進秘密AとBが一致しません(両方が必要かどうかわからない)。

ベストアンサー1

おすすめ記事