jonboy60.com – Linux, Tips, Tricks, Tutorial, Howto, News, Updates, Ideas, Blog, Magazine, Jonboy60, Open Source, Fedora, Ubuntu, OpenSuse, Linux Mint, CentOs

 


Howto disable X windows or GUI on startup

0
Posted May 19, 2010 by jonboy60 in Centos

Hey, I was wondering if it is possible to make it so on startup x windows is disabled, but I can login and start it using command startx?

Well, anything is possible. In fact many dedicated servers does not require x windows or gui, and they rely on ssh only. For security reason they just shut off the x windows as to say it is more secure that way.

If you are using Debian / Ubuntu, this is what you need to do:
1) Stop the X display for the current session, command:
$ sudo /etc/init.d/[g|x|w|k]dm stop
2) Now, you may put an “exit 0″ at the top of /etc/init.d/[g|x|w|k]dm file.
Or
$ dpkg –purge [g|x|w|k]dm

* [g|x|w|k]dm substituting it with all of the xdm(x11), gdm(gnome), kdm(kde), and wdm(wings)
* You can still start x windows with the startx command from any console shell.

If you are using Fedora / Centos, this is what you need to do:
1) Open file /etc/inittab
$ vi /etc/inittab
2) Find the line: “id:5:initdefault:”. Set the default runlevel to 3 (text mode) “id:3:initdefault:”.
3) Save and close the file.
4) Reboot. Now you will boot into text mode only.

* You can still start x windows with the startx command from any console shell.

~


0 Comments



Be the first to comment!


Leave a Response

(required)


7 − 3 =


CommentLuv badge