Home > Article > Operation and Maintenance > How to change root password in linux system
The methods for changing the root password in Linux are: 1. When the user has sudo permissions, the password can be changed directly; 2. When the user does not have permissions, long press the Shift key to enter Ubuntu Advanced in GRUB map mode. options to configure.
[Recommended course: Linux Tutorial]
The methods for changing the root password in Linux are:
The first one: the current user has sudo permissions
When the user has sudo permission, you can directly change the password as follows:
sudo su root #passwd
Use the command: sudo passwd root
Second type: When the user does not have sudo permissions
Restart the lunix system, long press the Shift key during startup to enter the GRUB map mode
Select Ubuntu advanced options, press Enter to enter the environment
and then press the e key to enter recovery mode. Enter the startup parameters. Press down to page to see the recovery nomodeset on the fourth line from the bottom. Delete it.
Then add quiet splash rw init=/bin/bash in the deleted place and then press F10 to start
After correct configuration, the system will directly enter root mode after running. Enter: passwd. The system will prompt you to enter a new password
Note: If the following error occurs, follow the prompts. Just install it correctly
#Summary: The above is the entire content of this article, I hope it will be helpful to everyone.
The above is the detailed content of How to change root password in linux system. For more information, please follow other related articles on the PHP Chinese website!