1. it is easy to modify the host name of CentOS. First, check the current host name # hostname to display the current host name. Modify the command to # hostnamectlset-hostnamename and then use the hostname or hostnamectlstatus command to check whether the change takes effect # hostnamectlstatusCentOS7 modify host 1 and CentOS modify host name
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.
In fact, the above process is mainly for reference in an article, except that most of his password is followed by root, which leads to my first update failure. Original article: reset the root password in CentOS7. It is only for learning and communication. please correct me.