Warum kann ich die Anzeige von Linux nach Linux exportieren?

Warum kann ich die Anzeige von Linux nach Linux exportieren?

lokale Maschine

[mukesh@centos ~]$ xhost 192.168.4.200
192.168.4.200 being added to access control list

Remote-VM-Maschine

[mukesh@centos ~]$ ssh [email protected]
[email protected]'s password: 
Last login: Fri Jul  7 02:38:07 2017
[user@labipa ~]$ DISPLAY=192.168.1.3:0.0;export DISPLAY
[user@labipa ~]$ firefox
Error: cannot open display: 192.168.1.3:0.0
[user@labipa ~]$ su -
Password: 
Last login: Fri Jul  7 02:47:53 EDT 2017 on pts/1
[root@labipa ~]# cat /etc/ssh/sshd_config | grep X11F
X11Forwarding yes
#   X11Forwarding no

Außerdem gemäßhttp://www.softpanorama.org/Xwindows/Troubleshooting/can_not_open_display.shtmlAnRemote-Computer

[root@labipa ~]#  netstat -tulpen | grep "\(177\|6000\)"
tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN      0          50364      1512/Xorg           
tcp6       0      0 :::6000                 :::*                    LISTEN      0          50363      1512/Xorg           
udp        0      0 0.0.0.0:177             0.0.0.0:*                           0          48805      1476/gdm     

contents of  /etc/gdm/custom.conf
[security]
DisallowTCP=false
[xdmcp]
Enable=true

Antwort1

Wenn die X11-Weiterleitung aktiviert istsowohl im Client als auch im Server, sshrichtet die DISPLAYVariable automatisch ein (für einen lokalen Proxy). Sie müssen sie nicht einstellen, und schon gar nicht direkt auf die IP-Adresse des Rechners; dadurch würden Sie den sshMechanismus komplett umgehen. Verwenden Sie , echo $DISPLAYum zu überprüfen, ob die Anzeige eingestellt ist ssh.

Wenn Sie die X11-Weiterleitung nur auf dem Server aktiviert haben (wie gezeigt) und sie nicht generell aktivieren möchten, können Sie ssh -Xsie auch im Client auf Einzelverwendungsbasis aktivieren.

verwandte Informationen