Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the single-user mode of Linux operating system

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "what is the single-user mode of Linux operating system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

As a Linux enthusiast, I am eager to get new knowledge every day, and at the same time, I also explore various parts of Linux over and over every day, which will inevitably make Linux unable to start. There is a protected mode in Windows, which can be entered into Windows in protected mode to repair the system. There is also a similar protected mode startup mode in Linux, which can be used to repair the system.

The commonly used startup modes under Linux are single-user mode, ordinary multi-user mode, complete multi-user mode and XWin mode. In the single-user mode, the system does not run completely, only part of the program runs, and it is not possible to log in to the Linux system remotely. Entering the single-user mode for system maintenance is completed by ROOT users, and it is directly entered by ROOT without password verification. At this time, the ROOT user has complete operation authority on the system, which can not only repair the system, but also destroy the system at any time. Some of the management of a single user is explained here:

I. the method of carrying out a single user

Since there are many ways to boot the Linux system, such as floppy disk boot, LILO boot, and GRUB boot, I will explain these methods respectively:

1. Floppy disk boot

When "BOOT:" appears after the floppy disk starts, you can set the startup parameters. After typing "Linux single" here, you can start the system in a single-user mode.

2. LILO mode

When starting in LILO mode, after the LILO prompt appears, you should quickly enter kernel/boot/vmlinuz-2.4.7-10 single roo=/dev/hda3. Here I use REDHAT7.2, the kernel is 2.4.7-10, and when using it, the file name is generally vmlinuz. You can copy this kernel file or establish a connection when the system is normal. Single is a single-use mode. Root=/dev/hda3 is the difference between the root of the Linux system, my computer is equipped with 98, if only Linux. It could be / dev/hda1, and on the second hard drive, it's / dev/hdb1. Here is the Linux method for identifying partitions.

3. GRUB mode

This way to boot is more complicated, enter the GRUB startup screen, press "C" to enter the GRUB command line, if there is a password, press "P" to enter the password and then enter the GRUB command line.

You can enter the following command on the command line for a single user. I will still take REDHAT7.2 as an example to illustrate that the first two sentences of kernel / boot/vmlinuz-2.4.7-10 single root=/dev/hda3initrd/boot/initrd-2.4.7-10.img boot (hd0,2) indicate the kernel file, and the keyword of the single user is still single. Different systems may have different file names. Boot (hd0,2) means

The third partition of the first hard disk boots.

II. Methods to prevent access to a single user

As a single user has complete control over the system, if the operation is improper or is entered by others, then the consequences will be unimaginable, how to prevent the entry of single users, there are the following aspects of attention.

1. Protect the / etc/inittab file. If you change 3 in id:3:initdefault to 1, you can directly enter the single-user mode every time you start. For the / etc/inittab file, enter as root and set the attribute to be unmodifiable by other users through chown700 / etc/inittab.

2. If you use lilo to boot, you may use Linuxconf or directly modify lilo.conf to set the waiting time for input when booting to 0 or the shortest time line. In this case, if you enter single-user mode, you can boot with a floppy disk.

3. If you boot in GRUB mode, the easiest way is to use the GRUB password to protect the startup options.

4. In order to prevent others from sabotaging remotely and restart the system, in addition to effectively managing the password of ROOT and the files under / etc directory, we should also set the password of CMOS, so that even if the system is changed to single-user mode, it is impossible to start the computer directly.

This is the end of the content of "what is the single-user mode of the Linux operating system". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report