ContentsChanging Your Root Password in UbuntuResetting a Root Password in UbuntuChanging the Root Password in CentOSReset Root Password in CentOS
Introduction
In Linux, rootprivileges (or root access) refers lớn a user trương mục that has full access lớn all files, applications, và system functions.
Bạn đang xem: 6
Most basic Linux user accounts run with limited privileges. This keeps users from making mistakes or accidentally exposing the system khổng lồ vulnerabilities.
To use protected operating system features, a Linux user has khổng lồ temporarily elevate their privileges using a command like sudo. The sudo command tells the system to run a command as a superuser, or root user. When you run a function using sudo, you’ll usually have khổng lồ enter your password.
Some versions of Linux will elevate your user privileges for a mix amount of time around (15 minutes) before reverting. Other versions only perform a single task with elevated privileges.
It’s a good idea lớn change your passwords regularly và consider using enterprise password management software.
This guide will help you change your Linux root password in Ubuntu or CentOS, or reset thepassword.


Reset Root Password in CentOS
This is a similar process as in Ubuntu, with a couple of variations.
Xem thêm: Chuyện Người Con Gái Nam Xương, (Trích Truyền Kì Mạn Lục)
Step 1: Access Boot Menu
Restart the system, then tap the Esckey about once per second to lớn launch the GRUB menu.
Step 2: Edit Boot Options
Use the arrows khổng lồ highlight the version of Linux you boot into, then press e.
Use the arrows khổng lồ highlight the line that starts with kernelor Linux.
Press E.
At the end of the line, showroom a space then type single. Press Enter, then boot into single-user mode by pressing Ctrl-X or B. (The system will display the command to lớn use.)
Step 3: Remount the Drive
You should have a command line, và you’ll have root privileges. To lớn enable read/write access on your hard drive, type the following:
mount / -o remount,rw
Step 4: Changing the Password
Type the following:passwdPress Enter, & the system should prompt you lớn enter and confirm a new password.
Step 5: Restart
Type the following, pressing enter after each line:
mount / -o remount,rosyncrebootYour system should restart.Confirm that your new password works by logging in.