How to set the default startup mode to command line mode in CentOS 7

As a Linux beginner, I installed a GUI version of the operating system by referring to the method in the article . There was only a minimally installed command-line version before.

# yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

 

After installation, start CentOS and enter the GUI version of the operating system directly. But I still think that the default startup method is still the command line mode. I found a lot of information on the Internet. Some netizens said to modify the inittab, but this file is no longer available under CentOS7; some netizens said that the following command was used, but I opened the command terminal. Terminal, after setting multi-user.target, it prompts Access denied.


systemctl set-default multi-user.target  //Set to command mode

systemctl set-default graphical.target   //Set to graphical mode

 

Later I figured out that it may be that root privileges are not used, because the default is to log in with user.

 

Also check the method of switching users in Linux, because I have only used exit in command line mode before, but if you use exit in Terminal, you will exit Terminal directly. Later, found the method in this article :

su root

 

After switching to root privileges, set multi-user.target again, success! After restarting the system, it returned to the previous command line mode.

 

Reprinted: http://blog.csdn.net/coderjeff/article/details/48915609

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326178567&siteId=291194637