首先点击查看苹果官网说明
image.png
那么我们下载软件XQuartz-2.7.11到mac系统并安装
image.png
bogon:~ wangxw$ XQuartz
#mac终端输入XQuartz 调出软件
image.png
打开偏好设置,勾选输入下的“模拟三按键鼠标”
image.png
如果修改了配置需要退出重新启动生效
选择“应用程序-终端”
image.png
终端窗口打开后输入:
xhost + 然后回车
bash-3.2$ xhost +
access control disabled, clients can connect from any host
登陆远程主机:
ssh -X username@host
输入密码登陆
bash-3.2$ ssh -X root@10.0.0.8
Activate the web console with: systemctl enable --now cockpit.socket
Last login: Tue Dec 29 19:05:12 2020 from 10.0.0.1
root@8 ~]#
root@8 ~]# yum -y install xorg-x11-xauth xorg-x11-fonts-* xorg-x11-font-utils xorg-x11-fonts-Type1 firefox
#下载安装
对DISPLAY变量设置:
root@8 ~]# export DISPLAY=localhost:10.0
root@8 ~]# firefox #打开火狐浏览器
image.png
我在linux centos8上搭建了nginx。mac上调用XQuartz的终端 把火狐打开 输入127.0.0.1 可以看到自己网站 证明firewall server端在linux上 client在mac上。
image.png