Single-user, rescue mode, clone virtual machine, Linux interconnection

Source: Internet
Author: User

If we forget the root password, we can change the password in the following ways
Single-user mode retrieve password
First, we'll restart the server.
The virtual machine needs to restart the power, the physical machine normal restart is good
Virtual Machine Restart mode

·
Press the arrow keys at the start screen to pause the countdown, select the first one, then press the E key to enter the Grub interface (Grud boot tool, management system boot)


·
Enter the Grud after the direction key, find the beginning of the linux16 line, press the ARROW key right cursor to "RO" behind

·
Modify the RO to RW, followed by a line command init=/sysroot/bin/sh this refers to the system position modified after ctrl+x exit

·
Enter Safe mode and command chroot/sysroot/to enter the system.

·
Because we installed the Chinese version of the system, Grud mode does not support Chinese, need to change the language, lang=en, modify the command passwd root change password (need to enter the password two times) before the end of the command touch/.autorlabel can be

·
Restart the server after the modification, sign in with the new password
·
·
·
Rescue Mode
When we accidentally deleted the Linux system files, resulting in no boot or some programs can not be used, forget Grud password we can use rescue mode
I am using a VM, I need to load the optical drive, the physical machine directly using the system USB flash drive, or the system CD on the line
The server shuts down, select Edit virtual machine settings, load virtual CD-ROM, connect hook at startup

·
Start the server, enter the BIOS or select the shortcut startup item, boot from CD


·
Start interface Select Troubleshooting Boot, then select Rescue a CentOS system entry


·
Enter this interface, press 1, select Continue, and then click Enter


·
Command chroot/mnt/sysimage/into the rescue mode system.

·
this time can be normal command, we can change the password, modified accidentally changed the wrong file
·
·
·
·
·
cloning a virtual machine
Do the experiment sometimes a virtual machine is not enough, we may need two or more, one to install too much trouble, then we can choose to clone the virtual machine, convenient, fast
VM, select Virtual machine right-click > Manage > Clone

·
The next step is to set the cloned virtual machine name, storage location

·
Point completion, boot start, because this virtual machine is cloned, so the IP address is the same, is not able to start networking colleagues, we need to modify the IP, remove the UUID

·
·
·
·
·
Linux Mutual Login
Two Linux machines logging into each other system
Command ssh on machine 1 + IP of another machine

·
At this point we have logged on to another machine.

·
·
If you want a secret key to connect on a machine, command Ssh-keygen to generate a secret key.
Then select the path, set the secret key password

·
Let's take a look at the location of the key store ls/root/.ssh can see the Id_rsa and id_rsa.pub two files, see the contents of the public key id_rsa.pub Cat/root/.ssh/id_rsa.pub

·
Copy the public key and paste it into another machine where the public key is placed


·
Then we enter the username and password to log in to the other server directly.

Single-user, rescue mode, clone virtual machine, Linux interconnection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.