Linux一般不需要图形化,但是偶尔也是需要的,基于X11协议的图形化XDMCP很受推广,VNC也是很不错的。。。
前提:
关闭防火墙,不关闭需要配置177端口放行
关闭selinux,不关闭自己配置selinux上下文
00、服务端图形化组件检测
yum groupinstall -y 'X Window System' 'Desktop' #根据平台不同自己选择安装图形化组件包
yum install -y gdm xdm #安装xdmcp依赖包
01、调整配置文件
vim /etc/X11/xdm/Xaccess
去掉这一行最前面的#号
* #any host can get a login window
[root@mvp gdm]# cat /etc/X11/xdm/Xaccess
# $XdotOrg: Xaccess,v 1.3 // :: cpqbld Exp $
# $Xorg: Xaccess,v 1.3 // :: cpqbld Exp $
# $XFree86: xc/programs/xdm/config/Xaccess,v 1.4 // :: tsi Exp $
#
# Access control file for XDMCP connections #xdmcp访问控制
#
# To control Direct and Broadcast access:
#
# pattern
#
# To control Indirect queries:
#
# pattern list of hostnames and/or macros ...
#
# To use the chooser:
#
# pattern CHOOSER BROADCAST
#
# or
#
# pattern CHOOSER list of hostnames and/or macros ...
#
# To define macros:
#
# %name list of hosts ...
#
# To control which addresses xdm listens for requests on:
#
# LISTEN address [list of multicast groups ... ]
#
# The first form tells xdm which displays to respond to itself.
# The second form tells xdm to forward indirect queries from hosts matching
# the specified pattern to the indicated list of hosts.
# The third form tells xdm to handle indirect queries using the chooser;
# the chooser is directed to send its own queries out via the broadcast
# address and display the results on the terminal.
# The fourth form is similar to the third, except instead of using the
# broadcast address, it sends DirectQuerys to each of the hosts in the list
# The fifth form tells xdm which addresses to listen for incoming connections
# on. If present, xdm will only listen for connections on the specified
# interfaces and/or multicast groups.
#
# In all cases, xdm uses the first entry which matches the terminal;
# for IndirectQuery messages only entries with right hand sides can
# match, for Direct and Broadcast Query messages, only entries without
# right hand sides can match.
# * #any host can get a login window 任何主机都可以登录 #
# To hardwire a specific terminal to a specific host, you can
# leave the terminal sending indirect queries to this host, and
# use an entry of the form:
# #terminal-a host-a #
# The nicest way to run the chooser is to just ask it to broadcast
# requests to the network - that way new hosts show up automatically.
# Sometimes, however, the chooser can't figure out how to broadcast,
# so this may not work in all environments.
# #* CHOOSER BROADCAST #any indirect host can get a chooser #
# If you'd prefer to configure the set of hosts each terminal sees,
# then just uncomment these lines (and comment the CHOOSER line above)
# and edit the %hostlist line as appropriate
# #%hostlist host-a host-b #* CHOOSER %hostlist # #
# If you have a machine with multiple network interfaces or IP addresses
# you can control which interfaces accept XDMCP packets by listing a LISTEN
# line for each interface you want to listen on. You can additionally list
# one or more multicast groups after each address to listen on those groups
# on that address.
#
# If no LISTEN is specified, the default is the same as "LISTEN *" - listen on
# all unicast interfaces, but not for multicast packets. If any LISTEN lines
# are specified, then only the listed interfaces will be listened on.
#
# IANA has assigned FF0X:::::::12B as the permanently assigned
# multicast addresses for XDMCP, where X in the prefix may be replaced
# by any valid scope identifier, such as for Node-Local, for Link-Local,
# for Site-Local, and so on. The default is equivalent to the example shown
# here using the Link-Local version to most closely match the old IPv4 subnet
# broadcast behavior.
#
# LISTEN * ff02:::::::12b # This example shows listening for multicast on all scopes up to site-local
#
# LISTEN * ff01:::::::12b ff02:::::::12b ff03:::::::12b ff04::::
:::12b ff05:::::::12b
vim /etc/gdm/custom.conf
[root@mvp gdm]# cat /etc/gdm/custom.conf
# GDM configuration storage [daemon] [security]
AllowRemoteRoot=true #许可root远程登录
[xdmcp]
Enable=true
Port=177
[greeter] [chooser] [debug]
02、Server运行方式切换
init 5 # init 3 && init 5
看到监听端口177,说明xdmcp服务没问题
[root@mvp xdm]# lsof -i:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gdm-binar root 11u IPv4 0t0 UDP *:xdmcp
03、xbrowser登录xdmcp
打开测试