Home >Operation and Maintenance >Linux Operation and Maintenance >How to switch to root user mode in linux
After the default installation is completed, we enter the Linux system with the current user permissions, but for many operations we need the root account permissions to operate.
The first command to enter the console is crtl Alt T.
By default, the password of the root user is not known after the installation is completed. The method of using root permissions is as follows:
1. Enter the sudo command
ubnutu64@ubuntu:~$ sudo
like this The current user password can obtain super user privileges. But by default, root permissions expire after 5 minutes.
2. sudo -i
ubnutu64@ubuntu:~$ sudo -i
You can enter the root user by entering the current user password in this way.
3. Use the root user
If you are using the root account for the first time, then we must first reset the root user’s password:
ubnutu64@ubuntu:~$ sudo passwd root
Afterwards, the system will ask you to enter the password of the root account twice. After confirmation, the password will be set. Then you can switch to the root user through the fourth step.
4. Switch to root user
ubnutu64@ubuntu:~$ su .....输入root密码
5. Exit root user
root@ubuntu:# exit
Related recommendations: " Linux tutorial》
The above is the detailed content of How to switch to root user mode in linux. For more information, please follow other related articles on the PHP Chinese website!