How to enter root authority in linux

The default root user of the system is not enabled under linux, which is exactly the opposite of MS windows, but windows XP will create an administrator user for automatic login after the system is installed, but Linux is different. This point also greatly increases the security of the system , but at the same time, it has some special requirements for our operation and use. Let's talk about how to enter the root authority of Linux.

It is recommended to use root user privileges only when modifying system settings or installing software.

1. Enable the root account

For desktop operating systems like Ubuntu, the root user is not enabled by default, that is, you cannot log in as the root user when you turn on the computer. When you enable the root user, you must set a password at the same time. Pay special attention to not enabling the root account to use other administrator users. Enabling the root account with root authority will increase the insecurity of the system.

Operation method:

Enter sudo passwd root (that is, change the password of root) in the terminal, press Enter, and follow the prompts

2. Temporarily use root privileges under the terminal

Directly enter sudo + the command you want to execute, and enter the current user password according to the prompt

3. Open a terminal with root privileges

Directly enter sudo su [note: not su]

Enter the password of the root user when the terminal prompts for a password

4. Of course, if you have special requirements, you must let the root user log in to the computer. Of course, I don’t say anything

Go to System–>Administration–>Login System (login window)

Open the Security (Security) tab, select Allow local administrator login (allow the local system administrator to log in), so that you can enter the root user password to log in to the computer next time you boot

5. For some important operations under graphics, such as installing software and modifying important system files, root authority is required. At this time, you will be prompted to enter the password. Note that only root authority is used at this time, not login root user.

When entering the password in the terminal, the entered characters will not be displayed, and you will not see any response on the screen, which is normal and for safety reasons.

Reposted from: How does linux enter root authority_linux root_Ordinary Netizen's Blog-CSDN Blog


su is to apply for switching the root user (switch user) , and you need to apply for the root user password. Some Linux distributions, such as ubuntu, do not set the password of the root user by default, so we need to set sudo passwd rootthe password of the root user first.

And sudo su is the current user's temporary application for root privileges, so the input is not the root user password, but the current user's password . Sudo is a user who applies for administrator privileges to perform an operation, and the operation here is to become an administrator.

expand:

Source: sudo_Baidu Encyclopedia

sudo is a linux system management command. It is a tool that allows system administrators to let ordinary users execute some or all root commands , such as halt, reboot, su, etc. This not only reduces the login and management time of the root user, but also improves security. sudo is not a replacement for the shell, it is for each command.

Its characteristics mainly include the following points:

§ sudo can restrict users to run certain commands only on a certain host .

§ sudo provides a rich log, which records in detail what each user has done . It can transfer logs to a central host or a log server.

§ sudo uses timestamped files to enforce a similar "ticket check" system. When a user invokes sudo and enters his password, the user gets a ticket with a lifetime of 5 minutes (this value can be changed at compile time) . After a period of time (the default is 5 minutes, which can be customized in /etc/sudoers), using sudo does not require entering the password again.

§ The sudo configuration file is a sudoers file , which allows system administrators to centrally manage user permissions and hosts. It is stored in /etc/sudoers by default, and the attribute must be 0440.


Before sudo was written around 1980, the general way for users to manage the system was to use su to switch to a super user. But one of the disadvantages of using su is that you must first tell the superuser's password.

Since the password of the superuser is not required, some Unix-like systems even use sudo to make ordinary users replace superusers as administrative accounts, such as Ubuntu, [Mac OS X] (Baidu Encyclopedia - Verify  OS X), etc.

Reposted from: https://www.cnblogs.com/jiading/p/11717388.html

Guess you like

Origin blog.csdn.net/fuhanghang/article/details/129297765