关于ssh后在使server端的图形界面显示到client端

解释一下startx命令运行后是启动的server端程序

 

A端登陆到B端

 

A端的设置

1 xhost + 允许其他用户在当前用户运行图形

2 vim /etc/ssh/ssh_config

    ForwardX11 yes

3 /etc/init.d/sshd restart

B端设置

1 DISPLAY=localhost:10.0

2  vim /etc/ssh/ssh_config

  X11Forwarding no 或者 ForwardX11Trusted yes

DISPLAY=localhost:10.0
localhost代表图形界面显示在哪个主机上
10代表 port_num - 6000 = 10
.0代表显示像素
如果是本地显示那么DISPLAY=:0.0

A>ssh -Xoracle@192.168.8.88
A端可以不用设置 forwardX11 yes 因为x就相当于yes了
登陆B后 xclock测试一下


版权声明:本文为zhoubo200原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。