Mobaxterm X server远程Linux服务器使用浏览器(firefox或google chrome)
还未完成时使用MobaXterm连接的界面如上,发现X11-forwarding错误,下面我们就来配置X11-forwarding
一、配置X Server
1、修改SSH配置
#vim /etc/ssh/sshd_config
X11Forwarding yes # 允许X11转发
X11UseLocalhost no # 不要让它走localhost,可能导致转发失败
AddressFamily inet # 使用Ipv4,有的地方可能ipv6不行
PasswordAuthentication yes # 允许用密码登录
PermitRootLogin yes #允许root用户登录
3、安装X11 Frowarding相关软件
#yum install xorg-x11-xauth xorg-x11-fonts-* xorg-x11-font-utils xorg-x11-fonts-Type1 xclock
4、重启SSH服务并重新连接
#service sshd restart
二、安装firefox
yum安装火狐浏览器软件
#yum -y install firefox
三、安装google chrome
1、下载rpm包并上传到Linux服务器
下载地址:
https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
2、yum强制安装
#yum localinstall google-chrome-stable_current_x86_64.rpm
3、修改google chrome配置
vim /usr/bin/google-chrome
#将原有的exec -a "$0" "$HERE/chrome" "$@"替换为如下
exec -a "$0" "$HERE/chrome" "$@" --user-data-dir --no-sandbox
四、运行测试
1、firefox
#firefox
2、google chrome
#google-chrome
附:报错解决
在ssh配置文件最后Host追加
XAuthLocation /usr/bin/xauth
#which xauth
获取xauth路径
ssh配置文件最后Host追加
XAuthLocation /usr/bin/xauth
#which xauth
获取xauth路径