In this article, I will show you how to configure your Linux system to use graphical (GUI) login with XDMCP service to access remote GUI. Most Linux admins work from shell and there is not much requirement to connect to the X window. But, in some cases, we need to access graphic console (X window Manager). For example, if a user needs to install Oracle and he/she might need access to Linux remote GUI; then I personally recommend to disable X manager, once the requirement is finished as part of security measures.
1) Edit inittab File
Usually, in /etc/inittab file, sysadmin would be setting it to level 3. So we have to change the level to 5. This makes it effective on the next restart.
# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
2) Enable X Window Manager
Enable X Window Manager (GDM or XDM or KDM). If it's already running, you can find which X window by running the below ps command. XDM and KDM are supported on older versions of Linux. From RHEL 5 onwards XDM X window manager is supported.
# ps ax | grep [gkx]dm
To enable XDM manager, you have to edit /etc/gdm/custom.conf file as below:
[xdmcp] Enable=true [security] DisallowTCP=false
3) Restart X Window
Restart X Window Services using init command:
[root@Server1 ~]# init 3
[root@Server1 ~]# init 5
4) Configure Access Rule
Next step would be to configure the access rules. Run gdsetup command.
a ) Click the Remote tab on GDM setup utility. Change the Style pull-down menu selection from 'Remote login disabled' to 'Same
b) Under the Security tab enable "Allow local system administrator login" and "Allow remote system administrator login"
5) Restart GDM Utility
Restart GDM utility service as below:[root@Server1 ~]# /usr/sbin/gdm-restart
You can now test X window using the below X command.
[root@Server1 ~]# X -query localhost :1
6) Open Firewall Ports
XDMCP are using the below ports and make sure these ports are open in the firewall.
XDMCP 177 UDP
X11 protocol 6000-6005 TCP
xfs: X font server 7100 TCP