Linux Disable and Remove X Windows (

I revived my new Dell server pre installed with Red Hat Enterprise Linux server v5.2. However, my box boot with a GUI login system ( Gnome ). There is no reason to run X Windows on my dedicated mail and Apache web server. I only need ssh. How do I disable X login and windows without reinstalling the operating system to improve security and performance?

CentOS / RHEL 5.x / Fedora Linux comes with X Windows system called The X Window System implementation included with the system is called There is no need to run X on a dedicated server such as web server or mail server or file server. Root (admin) user can login via SSH or on the text console (or may be using KVM).

Disable X Windows at System Boot

The /etc/inittab file describes which processes are started at bootup and during normal operation. This file is used to start X windows system at boot by setting default run level to 5. Edit the file /etc/inittab using a text editor such as vi, enter:
# vi /etc/inittab
Find line:



Replace with:



Save and close the file. Restart the server. You can also drop to text mode by typing init command:
# init 3

Delete X Windows from the Server

To remove the X11 RPMs (all packages) from the server, enter:
# yum groupremove "X Window System"
Above will remove 100-150 packages from the server. This make sure no one can start X on server by typing startx at the shell prompt. This will result into more secure system. Since, your box is dedicated server for web or mail serving, it is safe to delete the software from the system.

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Make Website WCAG Compliant?

Next Post

Link download Kali Linux 2020.1 (ISO + Torrent)

Related Posts