Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

ssh x11 forwarding

6 réponses
Avatar
Jeannot Lelapin
Bonjour,

le serveur : FreeBSD 7.0 (machine sans écran) sur lequel j'ai installé :
/usr/ports/x11/xauth
/usr/ports/x11-fonts/xorg-fonts
/usr/ports/x11/xhost
/usr/ports/x11/xdm

Pour le fichier de configuration du server ssh /etc/ssh/sshd_config
AllowTcpForwarding yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Pour le fichier de configuration du client ssh /etc/ssh_config ( dépend
de la machine cliente )
Host *
ForwardX11 yes


Pour la machine cliente :
soit un WinXP avec Cygwin+Package X ( les application X fonctionnent
très bien ).
soit un powerbook sous MacOS X 10.4.11 ( les applications X fonctionnent
très bien avec le serveur XDarwin ).

depuis l'une des machines clientes, je me connecte
ssh XX.XX.XX.XX -l user -X
export DISPLAY=localhost:10.0
xeyes &
X connection to localhost:10.0 broken (explicit kill or server shutdown).

alors :
xauth list
xauth: creating new authority file /home/user/.Xauthority
Il n'y a pas de fichier /home/user/.Xauthority
xauth generate localhost:10.0 .
xauth: creating new authority file /home/user/.Xauthority
X connection to localhost:10.0 broken (explicit kill or server shutdown).
et j'ai 2 fichiers
.Xauthority-c vide
.Xauthority-l vide

alors j'essaie une autre méthode
xhost +localhost
X connection to localhost:10.0 broken (explicit kill or server shutdown).
su
xhost +localhost
X connection to localhost:10.0 broken (explicit kill or server shutdown).

J'essaie de regarder les fichiers de log, j'ai chercher sur le net, je
ne trouve pas mon erreur.

Quelqu'un a un idée ?

Merci d'avance,

Jeannot

6 réponses

Avatar
Xavier
Le Jeudi 05 mars 2009 à 16:10, Jeannot Lelapin r> a écrit :

Bonjour,

le serveur : FreeBSD 7.0 (machine sans écran) sur lequel j'ai instal lé :
/usr/ports/x11/xauth
/usr/ports/x11-fonts/xorg-fonts
/usr/ports/x11/xhost
/usr/ports/x11/xdm

Pour le fichier de configuration du server ssh /etc/ssh/sshd_config
AllowTcpForwarding yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Pour le fichier de configuration du client ssh /etc/ssh_config (
dépend de la machine cliente )
Host *
ForwardX11 yes

Pour la machine cliente :
soit un WinXP avec Cygwin+Package X ( les application X fonctionnent
très bien ).
soit un powerbook sous MacOS X 10.4.11 ( les applications X
fonctionnent très bien avec le serveur XDarwin ).

depuis l'une des machines clientes, je me connecte
ssh XX.XX.XX.XX -l user -X
export DISPLAY=localhost:10.0
xeyes &
X connection to localhost:10.0 broken (explicit kill or server shutdown).

alors :
xauth list
xauth: creating new authority file /home/user/.Xauthority
Il n'y a pas de fichier /home/user/.Xauthority
xauth generate localhost:10.0 .
xauth: creating new authority file /home/user/.Xauthority
X connection to localhost:10.0 broken (explicit kill or server shutdown).
et j'ai 2 fichiers
.Xauthority-c vide
.Xauthority-l vide

alors j'essaie une autre méthode
xhost +localhost
X connection to localhost:10.0 broken (explicit kill or server shutdown).
su
xhost +localhost
X connection to localhost:10.0 broken (explicit kill or server shutdown).

J'essaie de regarder les fichiers de log, j'ai chercher sur le net, je
ne trouve pas mon erreur.



Pourquoi ne pas utiliser ssh -Y tout simplement ?
--
Xavier
Avatar
Paul Gaborit
À (at) Thu, 05 Mar 2009 21:23:36 +0100,
"Xavier" écrivait (wrote):
Pourquoi ne pas utiliser ssh -Y tout simplement ?



La seule différence entre l'option '-Y' et '-X' lors d'un ssh est le
niveau de confiance accordé par le serveur X11 aux clients qui passent
par ce canal. Si la connexion ne peut pas être établie du tout, ça ne
changera strictement rien. Au passage, 'xclock' ou 'xeyes' n'ont
absolument pas besoin de l'option '-Y' pour fonctionner via ssh.

--
Paul Gaborit - <http://perso.mines-albi.fr/~gaborit/>
Avatar
Manuel Bouyer
Jeannot Lelapin wrote:
[...]



depuis l'une des machines clientes, je me connecte
ssh XX.XX.XX.XX -l user -X
export DISPLAY=localhost:10.0



pourquoi ce export DISPLAY ? normalement ssh positionne la variable
DISPLAY lui meme (et la bonne valeur n'est pas forcement localhost:10);
s'il ne le fait pas c'est que le forward n'a pas marche (et donc
le export DISPLAY n'aidera pas).
Peut-etre que ssh -v en dira plus

--
Manuel Bouyer
NetBSD: 26 ans d'experience feront toujours la difference
--
Avatar
Jeannot Lelapin
Bonjour et merci Manuel,


Manuel Bouyer wrote:
Jeannot Lelapin wrote:
[...]



depuis l'une des machines clientes, je me connecte
ssh XX.XX.XX.XX -l user -X
export DISPLAY=localhost:10.0



pourquoi ce export DISPLAY ? normalement ssh positionne la variable
DISPLAY lui meme (et la bonne valeur n'est pas forcement localhost:10);
s'il ne le fait pas c'est que le forward n'a pas marche (et donc
le export DISPLAY n'aidera pas).
Peut-etre que ssh -v en dira plus



Et ben après la connection, le DISPLAY n'existe pas. Comme vous le
signalez très justement, c'est à SSH de le faire car il doit pouvoir
faire le forward qui si ca trouve ne marche même pas.
en mode -vvv, je ne trouve aucune ligne ressemblant à

debug2: x11_get_proto: /usr/bin/X11/xauth list :0.0 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 0

Qui doit lancer le /usr/bin/X11/xauth ? la machine distante sour FreeBSD
ou ma machine locales ( Powerbook sous MacOs ) ?

Cordialement,

Jeannot
Avatar
Erwan David
Jeannot Lelapin écrivait :

Bonjour et merci Manuel,


Manuel Bouyer wrote:
Jeannot Lelapin wrote:
[...]



depuis l'une des machines clientes, je me connecte
ssh XX.XX.XX.XX -l user -X
export DISPLAY=localhost:10.0



pourquoi ce export DISPLAY ? normalement ssh positionne la variable
DISPLAY lui meme (et la bonne valeur n'est pas forcement localhost:10);
s'il ne le fait pas c'est que le forward n'a pas marche (et donc
le export DISPLAY n'aidera pas).
Peut-etre que ssh -v en dira plus



Et ben après la connection, le DISPLAY n'existe pas. Comme vous le
signalez très justement, c'est à SSH de le faire car il doit pouvoir
faire le forward qui si ca trouve ne marche même pas.
en mode -vvv, je ne trouve aucune ligne ressemblant à

debug2: x11_get_proto: /usr/bin/X11/xauth list :0.0 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 0

Qui doit lancer le /usr/bin/X11/xauth ? la machine distante sour
FreeBSD ou ma machine locales ( Powerbook sous MacOs ) ?



La machine distante. sur la cible, ssh crée la variable DISPLAY
correspondant à sa socket d'écoute (localhost:n.0 -> écoute sur le port
6000+n) et utilise xauth pour créer la clef d'identification des
clients.


--
Le travail n'est pas une bonne chose. Si ça l'était,
les riches l'auraient accaparé
Avatar
Jeannot Lelapin
Hello and thanks,

now, i have new trouble :

In /etc/ssh/sshd_config on distant machine under FreeBSD, i write the
following line :
X11DisplayOffset 0
From my local machine under MacOSX :
ssh FreeBSD.IP -l user -X -vv
freezes
debug2: x11_get_proto: /usr/X11R6/bin/xauth -f
/tmp/ssh-0ceBE6TVyS/xauthfile generate MIT-MAGIC-COOKIE-1 untrusted
timeout 1200 2>/dev/null
Control+C does not work, i can just just kill it with kill -9

In /etc/ssh/sshd_config on distant machine under FreeBSD, de la machine
distante (FreeBSD), i write the following line :
X11DisplayOffset 10
i can connect from my local machine under MacosX with :
ssh FreeBSD.IP -l user -X -vv
echo $DISPLAY
localhost:10.0
and a ~/.Xauthority coherent file is created

when looking for in ssh log information :
debug2: x11_get_proto: /usr/X11R6/bin/xauth -f
/tmp/ssh-0ceBE6TVyS/xauthfile generate MIT-MAGIC-COOKIE-1 untrusted
timeout 1200 2>/dev/null
i cannot find the file /tmp/ssh-0ceBE6TVyS/xauthfile

with ssh FreeBSD.IP -l user -X -vvv, i find :

debug2: x11_get_proto: /usr/X11R6/bin/xauth -f
/tmp/ssh-gWMSeUy5lN/xauthfile generate MIT-MAGIC-COOKIE-1 untrusted
timeout 1200 2>/dev/null
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.

with ssh FreeBSD.IP -l user -Y -vvv, i find :
debug2: x11_get_proto: /usr/X11R6/bin/xauth list 2>/dev/null
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 0

now on the remote machine under FreeBSD :

$ echo $DISPLAY
localhost:10.0
$ xeyes &
$ debug1: client_input_channel_open: ctype x11 rchan 2 win 65536 max 16384
debug1: client_request_x11: request from FreeBSD.AdressIP 65334
Could not find ':' in DISPLAY:
debug1: failure x11
X connection to localhost:10.0 broken (explicit kill or server shutdown).

I'm looking for this new error

Any idea ?

Jeannot