文章目录
错误信息
- ssh服务器的x11 forwarding报错的解决
- xmanager运行报错:bash: /usr/bin/xterm: No such file or directory
- xshell链接服务器 /usr/bin/xauth: file /root/.Xauthority does not exist
1. ssh服务器的x11 forwarding报错的解决
# 1. 检查linux主机的配置
# 需要远程linux主机上配置OpenSSH服务,启用X11 Forwarding。在OpenSSH的配置文件中(/etc/ssh/sshd_config),打开如下两项:
AllowTcpForwarding yes
X11Forwarding yes
# 打开这两个选项,然后重启sshd服务。
# 注意:
# 使用X11 Forwarding并不需要在远程主机上运行桌面系统,即执行startx。使用X11 Forwarding需要安装rpm包xorg-x11-xauth,如果你在安装linux系统时,如果选择了安装X Window System,那这个包是默认安装的。
# 2. 安装xorg-x11-xauth 和 xclock,xclock 是用来测试gui输出的
[root@i-vfyxrtmx ~]# yum -y install xorg-x11-xauth xclock
# 3. 重启sshd, 或者 /etc/init.d/sshd restart
[root@i-vfyxrtmx ~]# systemctl restart sshd
2. xmanager运行报错:bash: /usr/bin/xterm: No such file or directory
# 1.原因: xterm没有安装,解决办法是下载然后安装即可。
# 如果机器可以用yum,则直接使用yum安装xterm即可:
# 如果没有网络,则在某台操作系统大版本相同的机器上(最好是同版本)先下载安装包,然后再上传安装。
yum install -y xterm
# 2. 下载 xterm, 下载不了换成yumdownloader即可
# libXpm是xterm的依赖包,libXaw是libXpm的依赖包
yum install --downloadonly --downloaddir=. xterm
yumdownloader libXpm libXaw #下载依赖包,下载软件包的另一种写法,如果上边的语句下载不了xterm改用这个命令下载
# 3. 安装, 上传到目标机器的某个目录,以root执行 或者 rpm -Uvh逐个包装即可
yum localinstall xterm
3. xshell链接服务器 /usr/bin/xauth: file /root/.Xauthority does not exist
# 1. 错误复现
xshell连接服务器的时候提示 /usr/bin/xauth: file /root/.Xauthority does not exist
# 2.原因分析: 一般是因为新服务刚安装好,在root下没有这个隐藏文件导致的,事实上他是可以自己自动重建的,也就是虽然有此提示,但在提示完后也自动创建了这个文件.
# .Xauthority文件可以在每个用户主目录中找到,用于存储xauth用于X会话的身份验证。启动X会话后,cookie将用于验证与该特定显示的连接。
[root@gaosh-1 ~]# ls .Xauthority
.Xauthority
# 3. 解决方案
一般的解决方案是退出重新登录即可,事实上这个也算不上报错,最多是个提醒
最后成功图形显示
4. xshell配色方案
先上图
配色方案 :skycolor.xcs, 或者自行下载,https://download.csdn.net/download/coolhe21cn/87808871
[skycolor]
text=00ff80
cyan(bold)=00ffff
text(bold)=e9e9e9
magenta=c000c0
green=80ff00
green(bold)=3c5a38
background=042028
cyan=00c0c0
red(bold)=ff0000
yellow=c0c000
magenta(bold)=ff00ff
yellow(bold)=ffff00
red=ff4500
white=c0c0c0
blue(bold)=1e90ff
white(bold)=fdf6e3
black=000000
blue=00bfff
black(bold)=808080
[Names]
name0=skycolor
count=1