X11 forwarding request failed on channel 0
Par Orgrim le vendredi 21 octobre 2011, 12:43 - NetBSD - Lien permanent
Quand j'essaye de me logguer sur ma box NetBSD fraichement passé en X.org modular, j'ai ça :
orgrim@serfouette ~ $ ssh rateau X11 forwarding request failed on channel 0 Last login: Fri Oct 21 12:20:24 2011 from serfouette.home.orgrim.net
WTF? ça tombe en marche SSH normalement.
Et bien le souci vient de l'échange des magic cookies pour l'authentification entre serveurs X à travers SSH, c'est utilisé par le X11 forwarding et on a besoin de plusieurs choses pour ça :
- le chemin complet vers
xauthsur le client - le chemin complet vers
xauthsur le serveur - Avoir
X11Forward yessur le serveur quand on le demande sur le client (il vautyesdans le/etc/ssh/ssh_configdu client par flemme de taper-Xsur la ligne de commande)
Le client est sous Linux, donc pas de soucis le chemin en dur /usr/bin/xauth dans le binaire sshd marche. Par contre pour NetBSD avec du X.org modular, il faut décommenter l'option XAuthLocation dans /etc/ssh/sshd_config et /etc/ssh/ssh_config pour donner le bon chemin vers xauth, comme indiqué en commentaire dans ces deux fichiers :
# If you use xorg from pkgsrc then uncomment the following line. # XAuthLocation /usr/pkg/bin/xauth
Enfin, comme le X11Forward est à no par défaut sur NetBSD, je l'ai activé. La vrai solution est de faire ça côté client en utilisant explicitement l'option -X quand on veut ouvrir des fenêtres sur le serveur.
Le pire c'est que Google ne sort rien sur le message "X11 forwarding request failed on channel 0", à part une question sans réponse sur un stackoverflow-like en Russe !
Commentaires
Hello (I'm sorry I don't know French, so I will just ask my question in English).
If I understand your post, you got an "X11 forwarding request failed on channel 0"
when trying to SSH somewhere and fixed the problem by telling ssh to in /usr/pkg/bin/xauth instead of /usr/bin/xauth.
However, I get the same error, and on my machine xauth really is at /usr/bin/xauth. I tried setting it explicilty (adding an XAuthLocation line in /etc/ssh/ssh_config) but it didn't help. Do you have any idea what is happening? Is this really the same problem that you had, or something different.
Cheers.
If xauth path are correctly set up, then your issue may come from the client wanting X11 forwarding while the server does not allow it. Just put X11Forward to yes on the server side, if you want that. Otherwise do not put it on the client nor use -X option on the client.
In my debian server, i didn't have xauth installed at all.
# apt-get install xauth
fixed the issue.