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 difference between linux single-user mode and multi-user mode

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what is the difference between linux single-user mode and multi-user mode". In daily operation, I believe that many people have doubts about the differences between linux single-user mode and multi-user mode. I have consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what are the differences between linux single-user mode and multi-user mode"! Next, please follow the editor to study!

The difference between single-user mode and multi-user mode in linux is that single-user mode skips pam authentication module and directly uses system maintenance function, while multi-user mode does not skip pam authentication module, and multi-user mode is the normal mode of server operation.

This article operating environment: linux7.3 system, Dell G3 computer.

What is the difference between linux single-user mode and multi-user mode

Single-user mode skips the pam authentication module and directly uses the system maintenance function.

Multi-user mode is generally the normal mode in which the server runs.

Single-user mode (English: Single user mode) is a mode with superuser privileges similar to working on a Linux system. Usually give 1 or S parameters in the boot menu to enter this mode. This mode has the opportunity to enter through the boot menu only when facing the host entity, thus ensuring that the super permission is granted to a superuser who can access the host. This operation is usually used for maintenance that needs to be done before the disk is mounted, such as maintaining the hard disk partition or changing the superuser password.

1. The method of implementing 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.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.

1.2LILO 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.

1.3GRUB 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.

2. 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.

2.1. protect the / etc/inittab file. If you change 3 in id:3:initdefault to 1, you can go directly to 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.2 if the lilo mode is used for boot, the waiting time for input during boot may be set to 0 or the shortest time line through Linuxconf or direct modification of lilo.conf. In this case, if you enter single-user mode, you can boot with a floppy disk.

2.3 if you boot using GRUB, the easiest way is to use the GRUB password to protect the startup options.

2.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 in the / etc directory, the password of CMOS should also be set, so that even if the system is changed to single-user mode, it is impossible to start the computer directly.

Ctrl + x exits and enters single-user mode

At this point, the study on "what is the difference between linux single-user mode and multi-user mode" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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