How to switch to root user in linux system

王林
Release: 2020-06-02 12:01:36
Original
49200 people have browsed it

How to switch to root user in linux system

There are many ways to switch to the root user in the Linux system, as follows:

1. sudo command

$ sudo
Copy after login

After executing the command, Enter the password of the current administrator user to briefly gain superuser privileges.

2. sudo -i command

$ sudo -i
Copy after login

Use this command to directly enter the password of the current administrator user to enter the root user.

3. If we want to always use root privileges, we can use the su command.

First execute the following command to reset the password of the root user.

$ sudo passwd root
Copy after login

Then you can freely switch to the root user.

Execute the command:

$ su
Copy after login

Then enter the password of the root user to switch to the root user.

If we want to return to normal user rights, just execute the command "su xxx" or "exit" directly.

Recommended tutorial: linux tutorial

The above is the detailed content of How to switch to root user in linux system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!