One, single user mode (forget the administrator password when what to do?) )
Restart command:
Reboot
Init 6
Shutdown-r now
Shutdown command
Init 0
Poweroff
1. Restart the machine
When the following interface appears, press the arrow keys (up or down) on the keyboard to select the options below
CentOS Linux (3.10.0-862.e17.x86_65) 7 (Core)
After clicking on the letter "E" key on the keyboard, the following window appears
The Red Label: RO modified to RW init=/sysroot/bin/sh modified to press the CTRL and X keys on the keyboard, and then restart the following interface
Enter the following command after entering this interface
chroot/sysroot/switch to this directory
Lang=en to define the system language as English
passwd Root Modify Administrator password command
After earning this command, you will be required to enter a new password, the new password must be 8 bits,
After you enter the new password on both sides
Again income the following command
Touch/.autorelabel
After entering this command, you can restart the machine.
Second, rescue mode (CD-ROM boot mode)
is to use the CD-ROM boot mode for system file repair
Ls-l/usr/lib/systemd/system/runlevel*target
This command will show the 7 modes of startup
1, set the system BIOS to the CD-ROM priority boot mode,
Select a third option after system startup (troubleshooting)
Then choose Rescue a CentOS Linux system select Enter
Selection) 1Continue
It goes into the system and then changes the file,
Chroot/mut/sysimage Loading Directory
passwd Root Modify Administrator password
Restart the system after entering a new password
This rescue mode can be used to modify the file in case of system failure.
Iii. Cloning virtual machines
1, in the virtual machine state, right click on the virtual machines appear menu----management-----cloning, such as
Click Next---Select the current status of the virtual machine----next----Create a linked clone-----next----complete
Such as
After cloning is complete, go to the virtual machine system and do the following three actions
1. Modify the IP address
2. Remove the network card address (UUID)
The following network services need to be restarted after the modification is completed
VI/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ENS33 Modifying network information
Systemctl Restart network.service Restart Network Service command
3. Modify the computer name
Hostname View Host name commands
Hostnamectl set-hostname BILIANG3 change hostname to BILIANG3
Exit the computer hostname will take effect after exiting the current account.
Hostname configuration file storage location/etc/hostname
View Host name Profile location command
Cat/etc/hostname
Next, we'll use the Xshell to connect the two file hosts.
After copying the connection, modify
Iv. Linux machines log in to each other
The W command is to view the system load command
SSH login command for remote machine
Command format: SSH [email protected] Address
Logout Exit Login Command
Ssh-keygen Command Generation Key tool
Cat/root/.ssh/id_rsa.pub View the key file and copy the key contents to the Linux machine you want to connect to,
Vi/root/.ssh/authorized_keys edit the key file and copy the Linux public key that will be connected, such as:
Delayed a day
4th Day of the Linux CentOS study (June 7, 2018)