How to disable graphic interface in CentOS/RHEL 7?

When the graphic interface is installed, by default, we will enter graphic mode. How can we disable it?

Well, it’s kinda easy as below:

# mv /etc/systemd/system/default.target /etc/systemd/system/default.target.bak
# ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
# systemctl reboot

The first command creates a backup, and the second command sets command-line mode as default. Then reboot system to take effect.

The way to enable graphic interface is as simple as below:

# ln -sf /etc/systemd/system/default.target.bak /etc/systemd/system/default.target
Share Button

Leave a comment

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