CentOS (iv)--linux system start-up level

Source: Internet
Author: User

For the vast majority of Linux programmers, after entering the Linux system is generally seen a dark interface (development mode), because the system if you start the selection of development mode, will reduce startup time, optimize memory and so on. But usually we just install the Linux system, and then go in after the graphical interface, (if you want to switch to development mode, using the shortcut key Ctrl + F2), the return from the development mode to the graphical interface using shortcut keys (Ctrl + F1), or the command line to enter the command startx command to switch to the graphical interface.

Note : If you are booting from the boot mode setting is the graphical interface, then through the shortcut keys (Ctrl + Alt + f2~f7) into the terminal interface,
You enter the command startx is not return to the graphical interface. But if you start the boot mode setting is the development mode, then the input command STATX can be returned to the graphical interface

Linux system Setup system boot mode can be modified (must be logged in as root to modify). The configuration file that modifies the system startup mode is /etc/inittab.

After we switch to the root user and then Vi/etc/inittab, we can modify and view the configuration file:

[Email protected] ~]:# Vi/etc/inittab

After entering the above command, we can see the following information in the configuration file:

 # Inittab is only used by upstart for the default runlevel.## ADDING other Configurati On the here would have NO EFFECT on YOUR system.## SYSTEM initialization is started by/etc/init/rcs.conf## individual runlevel  S is started by/etc/init/rc.conf## Ctrl-alt-delete was handled by/etc/init/control-alt-delete.conf## Terminal Gettys are  Handled by/etc/init/tty.conf and/etc/init/serial.conf,# with configuration in/etc/sysconfig/init.## for information on How to write upstart event handlers, or how# upstart works, see Init (5), init (8), and Initctl (8). #  # Default Runle Vel. The runlevels used are:#   0-halt (do not set Initdefault to this) # 1-single user mode# 2-multi User, without NFS (the same as 3, if you don't have networking) # 3-full multiuser mode# 4-unused# 5-x11# 6 -Reboot (do not set Initdefault to this) #id: 5:initdefault:  ~  

We see the last few lines, we can see the Linux system in the default system boot a total of 7, namely:

0: Shut down (do not set this!) )
1: Single user (similar to the security mode of the Windows operating system)
2: Multi-user status No NETWORK service
3: Multi-user state by Network Service (when doing development, usually set to this boot level, directly into the command line interface)
4: The system is not used reserved to the user (do not set this!) )
5: Graphical interface (this is the Linux default boot level, directly into the graphical interface)
6: System reboot (do not set this!) )

The following sentence:

Id:5:initdefault:   //Set the system default boot level

is used to set the default boot level of the system, the Linux system is the default boot level 5, that is, the graphical interface to start

If you need to change the default level to development mode, just change the 5 to 3

Such as:

Change Id:5:initdefault: To   Id:3:initdefault:

Then save the exit and restart the system input reboot command.

Warning: Do not set the boot base to 0, 4, 6!!!!!!

You will find that the interface to the Linux system has become a developer mode!

If we just need to do development, deployment projects on Linux, we recommend that you generally set the system startup mode to Development mode!

Note
If a malicious user sets the system boot level to 0, 4, 6 , how do we solve this problem?
In the Linux system Boot screen, we quickly press the "E" button on the keyboard, and then into the Grub boot interface (this may be different depending on the Linux version, my CentOS6.4 is required to press F2 to enter the boot interface at startup,
This can be based on the installation of the Linux system when booting the prompt to enter the boot interface),
The single-user level starts up (why not set it to 3 or 5, because the Linux system first checks the boot level of the/etc/inittab file at startup, and if it is set to 5 or 3 at this point, the system still can't get in, only set to 1 after setting up, press the "B" button on the keyboard, the system will be able to reboot and enter the single user level, so that we can follow the previous method to modify the Linux system boot level.

I personally prefer the pure command mode, feeling the window mode sometimes card. The above content is reproduced, only for learning to use.

CentOS (iv)--linux system start-up level

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.