Home > Operation and Maintenance > Linux Operation and Maintenance > How to switch to root user in linux system

How to switch to root user in linux system

王林
Release: 2020-07-09 12:28:26
Original
29280 people have browsed it

The method to switch to the root user under the Linux system is: 1. Execute the [sudo passwd root] command; 2. Set the password of the root user; 3. Execute the [su root] command so that you can switch freely The root user is here.

How to switch to root user in linux system

Specific command:

(Recommended tutorial: linux tutorial)

(1) Use sudo command

xzm@ubuntu:~$  sudo
Copy after login

Then enter the current administrator user password to obtain super user privileges. But by default, root permissions expire after 5 minutes.

(2) You can use the sudo -i command

xzm@ubuntu:~$  sudo -i
Copy after login

Then, enter the password of the current administrator user to enter the root user.

(3) If you want to always use root privileges, you must switch to the root user through the su command

First, set the password of the root user:

xzm@ubuntu:~$  sudo passwd root
Copy after login

This way you can set The root user's password.

After that, you can freely switch to the root user

xzm@ubuntu:~$  su
Copy after login

Enter the password of the root user.

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:
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template