Disable GUI
How do you disable the GUI (X server?) in Linux for server machines that don't require anything but a command-line interface? I'm a newbie but I've read about runlevel 3 - is running it in runlevel 3 the standard way of disabling GUI for production servers?
Also, how can you remove the GUI functionality so that you can't do startx or start up the GUI or X server in any way, because I wouldn't want the option to start the X server on a production machine? Thanks. |
First, edit /etc/inittab and change whatever the current runlevel is and change it to the one you need (I won't give the numbers as I think some distros have different numbers to others). This will stop your OS from booting into GUI by default.
Then uninstall Xorg and KDE or Gnome or whatever your GUI is with your package manager. |
I would simply not install the GUI to begin with. I prefer a slim server containing ONLY the basics necessary for operation and the additional daemons for the servers purpose..
This is simple to achieve with Debian, and Ubuntu Server, just don't select desktop environment during install. I would imagine RHEL / CentOS can't be much different, I would think there would be an option during install to install or not install the GUI. RedHat if I recall runlevel 3 is without GUI and runlevel 5 is with GUI. http://www.redhat.com/docs/manuals/e...utdown-rl.html |
All of the default installations of RHEL include GNOME.
You can install without X or GNOME by customizing the package selections and removing those options from the list. If you've already installed all of it, you can use the Add/Remove Software option in the menu to get rid of GNOME from Desktop Environment set and X Window System from the Base System set. If disk space isn't an issue, you could also just boot to runlevel 3 and then chmod /usr/bin/startx to 700. That will remove all users' permissions to that command, except root. This would probably be the quickest and least intrusive option. |
Quote:
Ubuntu, IIRC (I don't have my laptop in front of me) starts you in what it calls runlevel 2, which is runlevel 5. If you change to runlevel 5, you get the same thing. Most standard and reliable way (I think) would be for the poster to set runlevel 3 then edit the /etc/rc3.d directory (wherever that actually is on his distr) to make sure the display manager is removed and won't start. |
Quote:
|
Out of curiosity, is it possible to 'disable' a runlevel - in particular 5, maybe perhaps 2 and 4?
Quote:
|
Quote:
If this indeed is a security related question, then I think running a GUI interface is very low on the priority list. |
All times are GMT -5. The time now is 01:12 AM. |