• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 6,7 : How to enable or disable XDMCP service (GDM)

By admin

GDM can be configured to allow remote access via XDMCP (X Display Manager Control Protocol). We can use Cygwin-X or Exceed, to connect remotely to a server and get a complete desktop GUI.

Enabling XDMCP service

1. Edit the file /etc/gdm/custom.conf and make sure below parameters are added/set.

# vi /etc/gdm/custom.conf
# GDM configuration storage
[daemon]
[security]
DisallowTCP=false
AllowRemoteRoot=true
[xdmcp]
Enable=true
[greeter]
[chooser]
[debug]

2. Restart the gdm service.
For RHEL 6

# init 3
# init 5

For RHEL 7

# systemctl restart gdm.service

3. Additionally, it will be required to allow connections from remote clients’ tcp ports in the 6000 range (since the clients will be acting as an X server, using port 6000/tcp and above). As an example, one could configure a rule with iptables that matches via source ports, e.g.:
For RHEL 6

# iptables -I INPUT -p tcp --sport 6000:6010 -j ACCEPT

For RHEL 7

# firewall-cmd --permanent --zone=public --add-port=6000-6010/tcp
# firewall-cmd --permanent --zone=public --add-port=177/udp
# firewall-cmd --reload

4. Confirm gdm is listening on UDP port 177

# netstat -anu|grep 177
udp        0      0 0.0.0.0:177                 0.0.0.0:*

Disabling XDMCP service

1. TO disable XDMCP service, just edit the file /etc/gdm/custom.conf and make sure the parameters are unset.

# vi /etc/gdm/custom.conf
# GDM configuration storage
[daemon]
[security]
[xdmcp]
[greeter]
[chooser]
[debug]

2. Save the /etc/gdm/custom.conf file and restart the GDM service.
For RHEL 6

# init 3
# init 5

For RHEL 7

# systemctl restart gdm.service

Troubleshooting

Follow the steps below in case XDMCP is not working on the server or GDM is not starting (user ‘gdm’ doesn’t exist).
1. Verify that the desktop is installed properly:

# yum groupinstall "Desktop"

2. Create the gdm user:

# useradd -u 42 -r -s /sbin/nologin -d /var/lib/gdm gdm

3. Correct permissions on /var/lib/gdm.

# chown -R gdm:gdm /var/lib/gdm

4. Restart XDMCP/GDM.

# init 3
# init 5

5. You should now be able to run GDM and use the graphical environment.

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to Enable/Disable CPUs (Limiting CPU count) in CentOS / RHEL
  2. How To Setup UDEV Rules For RAC OCR And Voting Devices on Partitions
  3. Yum Fails with “Error: database disk image is malformed” in /var/log/messages
  4. The System Continuously Displayed the Error Message from the “avahi-demon” in /var/log/messages
  5. How to Back Up and Restore XFS File Systems (xfsdump / xfsrestore)
  6. How to troubleshoot iSCSI issues in CentOS / RHEL 6,7
  7. CentOS / RHEL 6,7 : How to disable or delete virbr0 interface
  8. Bash for loop Examples
  9. How To Create/Remove and Mount a Stratis Filesystem in CentOS/RHEL 8
  10. UNIX / Linux : How to install and configure mutt

You May Also Like

Primary Sidebar

Recent Posts

  • What are different Oracle Database Vault Roles
  • Unable to export realm protected table using data pump
  • Beginners Guide to Oracle Database Vault
  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary