CentOS7 reset root password change host name
1. Modify the Host Name of CentOS
It is easy to modify the host name in CentOS. First, check the current host name.
#hostname
The current host name is displayed. Modify the command
#hostnamectl set-hostname name
Run the hostname or hostnamectl status Command to check whether the change has taken effect.
#hostnamectl status
CentOS7 is easy to modify the host name. The following describes how to reset the root password.
Ii. Reset the root password
Start CentOS and press
Go to the editing page
Find the line in Linux 16 and change ro to rw init =/sysroot/bin/sh.
Now press Control + x to start in Single User Mode
Now, you can use the following command to access the system
chroot /sysroot
Then type the command
password
Press enter, enter the new password as prompted, and then execute
touch /.autorelabel
Then execute
exitreboot
You can.